Kexi/Junior Jobs/Map Browser Form Widget
< Kexi | Junior Jobs
Web browser widget is a GUI element that displays web page and allows for navigation experience similar to regular web browsers.
Proposed and mentored by Jstaniek 22:37, 17 February 2011 (UTC)
Map browser widget is a GUI element that displays globe and map for given location.
Proposed and mentored by Jstaniek 22:37, 17 February 2011 (UTC)
Definitions
- Kexi Forms: one of Kexi core plugins, provided for handling form-based data entry and browsing. A form is consisted of widgets, possibly nested. The implementation of Kexi froms is independent of the Qt Designer forms but similar in many regards. The differences most visible to the user are:
- definitions of kexi forms are stored in the kexi project, i.e. databaseeven if in the future, exporting to separate file could be provided);
- kexi forms offer data-aware widgets, e.g. text boxes, that can be bound to database table or query fields.
- Kexi form widgets and factories: building blocks of kexi forms, e.g. buttons, text boxes. Technically, kexi widgets can be instantiated through Kexi widget plugins, so called factories. Each widget is of a given class, named using identifier (unique within the whole kexi session). One widget factory can be capable of creating widget instances of one or more classes. Kexi has currently two built-in factories: standard factory and container factory (these would be finally merged into one since there is no point in separation). Built-in factory means that it is always available in the default kexi build and should be thus present in properly packaged kexi application.
The Goal
Deliver extra "Map Browser" widget compatible with Kexi Forms.
Requirements
- Design and implement widget and provide it through separate factory using the kexi widget factory API
- All the code should be stored in this tree in calligra/:
kexi/formeditor/factories/mapbrowser/CMakeLists.txt kexi/formeditor/factories/mapbrowser/MapBrowserFactory.h kexi/formeditor/factories/mapbrowser/MapBrowserFactory.cpp kexi/formeditor/factories/mapbrowser/MapBrowserWidget.h kexi/formeditor/factories/mapbrowser/MapBrowserWidget.cpp
- To implement the widget derive from Marble::MarbleWidget class
- Do not export the any class, just export the plugin using K_EXPORT_KEXI_FORM_WIDGET_FACTORY_PLUGIN(MapWidgetFactory, mapbrowser) in MapBrowserFactory.cpp
- Class name of the widget should be KexiMapBrowser
- User-visible name of the widget should be "Map Browser"
- Name prefix of the widget should be "map"
- User-visible description of the widget should be "Map browser"
- class name of the factory should be MapBrowserFactory, and the name passed to the KFormDesigner::WidgetFactory constructor should be "mapbrowser"
- provide translations (i18n()) for all user-visible property names in the factory constructor (see StdWidgetFactory for reference), e.g.
m_propDesc["longitude"] = i18n("Longitude");
- hide properties "presistentTileCacheLimit", "volatileTileCacheLimit", "mapThemeId" for users (these are too technical)
- the build should be allowed for mapbrowser/CMakeLists.txt only if the marble library, try to copy appropriate FindMarble.cmake file to calligra/cmake/modules
- Testing: proper implementation should after installing provide map browser widget within the widget palette of "Form Design" tab. Inserting the map browser widget should show it, changing properties through the property editor should work, switching to data view mode should display the browser properly and the browser's contents (map) should be available for zooming (using the wheel) and panning (using the mouse move). All these mouse actions should be disabled on the widget in design mode, so the user is able to drag and drop the widget within the form.
Extensions
- Data binding: ideally, any data properties should be provided for read/write binding to the database source; however to do this, custom binding GUI in the form designer should be delivered; this is not yet supported by Kexi API
- (Projection, longitude, latitude) tuple could be combined in a single data structure and supported natively in kexi as extra data type for easier binding
Hints
- The directory of the forms framework is kexi/kformeditor/, standard factory is implemented in kexi/formeditor/
- The widget factory API is provided by the KFormDesigner::WidgetFactory base class. Inherit it as StdWidgetFactory does.
- The MarbeWidget is exposed in Qt Designer if you compile it or install appropriate 'devel' package. Trying the MarbleWidget in the Qt Designer can be useful to get accustomed with the features. Similarly, it is suggested to try the Marble application.
After implementation
TODO: we have to update calligra/README.PACKAGERS document to indicate that the plugin must be packaged separately to avoid hard dependency on Marble libraries
Further works
- Exposing the maps to KoReports (update 2011-04-26: required by GSoC)
- Exposing the maps as a flake shape (for any Flake-capable app) (update 2011-04-26: required by GSoC)
- Note: Much of this has been already implemented: http://websvn.kde.org/trunk/playground/office/kofficeplugins/geoshape/
Hint: vector-based maps would be good for printouts in the above cases.
Development
This is a notepad for development
Discussions
- (2011-04-28) Log from discussion with Marble team -- jstaniek asked about zooming in marble view, from reports and flake perspective it's important; in QWidget world it's different compared to QGraphicsView; probably asking for 2000 pixels or so big rendering scene and setting proper zoom in QPainter would deliver appropriate DPI; Radek will test this idea; also asked about vector support -- they'll have openstreetmap vectors but do not have now; annotations are vector of course (e.g. pathways or names); some testing will show how nice the content looks on print.