• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

SystemSettingsView

BaseMode Class Reference

Provides a interface for System Settings views. More...

#include <BaseMode.h>

Inheritance diagram for BaseMode:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ToolBarItemsFlags { NoItems = 0x1, Search = 0x2, Configure = 0x4 }

Public Slots

virtual void addConfiguration (KConfigDialog *config)
virtual void loadConfiguration ()
virtual void saveConfiguration ()
virtual void searchChanged (const QString &text)

Signals

void actionsChanged ()
void changeToolBarItems (BaseMode::ToolBarItems items)
void viewChanged (bool state)

Public Member Functions

 BaseMode (QObject *parent)
virtual ~BaseMode ()
virtual KAboutData * aboutData ()
virtual QList< QAction * > & actionsList () const
virtual void giveFocus ()
void init (const KService::Ptr modeService)
virtual void initEvent ()
virtual void leaveModuleView ()
virtual QWidget * mainWidget ()
virtual ModuleView * moduleView () const
virtual void saveState ()
const KService::Ptr & service () const

Protected Member Functions

KConfigGroup & config () const
MenuItem * rootItem () const
virtual QList
< QAbstractItemView * > 
views () const

Detailed Description

Provides a interface for System Settings views.

BaseMode is a standard interface for all plugins to System Settings to allow them to provide their own interface to KDE control modules.

The developer need only ensure that they perform all initialization of their plugin in initEvent() to ensure that the plugin is displayed, and initial actions are loaded.

Author:
Ben Cooksley <ben@eclipse.endoftheinternet.org>
Mathias Soeken <msoeken@informatik.uni-bremen.de>

Definition at line 47 of file BaseMode.h.


Member Enumeration Documentation

enum BaseMode::ToolBarItemsFlags

These flags are used to control the presence of the Search and Configure actions on the toolbar.

Enumerator:
NoItems 

The Toolbar will not have any items added by System Settings.

Search 

The Toolbar will have the search bar added by System Settings.

Configure 

The Toolbar will have configure added by System Settings.

Definition at line 73 of file BaseMode.h.


Constructor & Destructor Documentation

BaseMode::BaseMode ( QObject *  parent  )  [explicit]

Constructs a BaseMode for use in System Settings.


Plugin developers should perform all initialisation in initEvent() not here.

Parameters:
parent The parent of this BaseMode.

Definition at line 44 of file BaseMode.cpp.

BaseMode::~BaseMode (  )  [virtual]

Normal destructor.

Plugin developers only need destroy what they created not what is provided by BaseMode itself.

Definition at line 50 of file BaseMode.cpp.


Member Function Documentation

KAboutData * BaseMode::aboutData (  )  [virtual]

Provides information about the plugin, which is used in the About dialog of System Settings.


This does not need to be implemented, and need only be implemented if the author wants information about the view displayed in the About dialog.

Returns:
The about data of the plugin.

Definition at line 73 of file BaseMode.cpp.

void BaseMode::actionsChanged (  )  [signal]

Triggers a reload of the views actions by the host application.

Warning:
Actions previously contained in the list must not be destroyed before this has been emitted.
QList< QAction * > & BaseMode::actionsList (  )  const [virtual]

Provides the list of actions the plugin wants System Settings to display in the toolbar when it is loaded.

This function does not need to be implemented if adding actions to the toolbar is not required.

Returns:
The list of actions the plugin provides.

Definition at line 83 of file BaseMode.cpp.

void BaseMode::addConfiguration ( KConfigDialog *  config  )  [virtual, slot]

Allows views to add custom configuration pages to the System Settings configure dialog.

Warning:
Deleting the config object will cause System Settings to crash

Definition at line 110 of file BaseMode.cpp.

void BaseMode::changeToolBarItems ( BaseMode::ToolBarItems  items  )  [signal]

Causes System Settings to hide / show the toolbar items specified.

This is used to control the display of the Configure and Search actions

Parameters:
items The items that are wanted in the toolbar
KConfigGroup & BaseMode::config (  )  const [protected]

Provides access to the configuration for the plugin.

Returns:
The configuration group for the plugin.

Definition at line 128 of file BaseMode.cpp.

void BaseMode::giveFocus (  )  [virtual]

Used to give focus to the plugin.

Plugin should call setFocus() on the appropriate widget

Note:
Failure to reimplement will cause keyboard accessibiltity and widget focusing problems

Definition at line 106 of file BaseMode.cpp.

void BaseMode::init ( const KService::Ptr  modeService  ) 

Performs internal setup.


Plugin developers should perform initialisation in initEvent() not here.

Parameters:
modeService Plugins service object, used for providing extra information to System Settings.

Definition at line 55 of file BaseMode.cpp.

void BaseMode::initEvent (  )  [virtual]

Prepares the BaseMode for use.


Plugin developers should perform initialisation here, creating the Models. They should perform widget initialisation the first time mainWidget() is called, not here.

Definition at line 64 of file BaseMode.cpp.

void BaseMode::leaveModuleView (  )  [virtual]

Causes the view to unload all modules in the module view, and return to their module selection state.

Warning:
Failure to reimplement will cause modules to not be unloaded when changing views. This must be implemented.

Definition at line 102 of file BaseMode.cpp.

void BaseMode::loadConfiguration (  )  [virtual, slot]

Allows views to load their configuration before the configuration dialog is shown Views should revert any changes that have not been saved.

Definition at line 115 of file BaseMode.cpp.

QWidget * BaseMode::mainWidget (  )  [virtual]

Returns the widget to be displayed in the center of System Settings.


The widget should be created the first time this function is called.

Warning:
This function is called multiple times, ensure the widget is only created once.
Returns:
The main widget of the plugin.

Definition at line 68 of file BaseMode.cpp.

ModuleView * BaseMode::moduleView (  )  const [virtual]

Provides access to the ModuleView the application uses to display control modules.


Warning:
Failure to reimplement will cause modules not to be checked for configuration changes, and for the module to not be displayed in the About dialog. It must be implemented.
Returns:
The ModuleView used by the plugin for handling modules.

Definition at line 78 of file BaseMode.cpp.

MenuItem * BaseMode::rootItem (  )  const [protected]

Returns the root item of the list of categorised modules.

This is usually passed to the constructor of MenuModel.

Warning:
This is shared between all views, and should not be deleted manually.
Returns:
The root menu item as provided by System Settings.

Definition at line 123 of file BaseMode.cpp.

void BaseMode::saveConfiguration (  )  [virtual, slot]

Should be implmented to ensure that views settings are saved when the user confirms their changes Views should also apply the configuration at the same time.

Definition at line 119 of file BaseMode.cpp.

void BaseMode::saveState (  )  [virtual]

The state of the plugin ( position of the splitter for instance ) should be saved to the configuration object when this is called.

Definition at line 98 of file BaseMode.cpp.

void BaseMode::searchChanged ( const QString &  text  )  [virtual, slot]

Called when the text in the search box changes allowing the display to be filtered.

Warning:
Search will not work in the view if this function is not implemented.

Definition at line 93 of file BaseMode.cpp.

const KService::Ptr & BaseMode::service (  )  const

Provides the service object, which is used to retrieve information for the configuration dialog.

Returns:
the service object of the plugin.

Definition at line 88 of file BaseMode.cpp.

void BaseMode::viewChanged ( bool  state  )  [signal]

Should be emitted when the type ( list of modules / display of module ) of displayed view is changed.

Parameters:
state Determines whether changes have been made in the view.
Warning:
Failure to emit this will result in inconsistent application headers and change state.
QList< QAbstractItemView * > BaseMode::views (  )  const [protected, virtual]

Provides access to item views used by the plugin.

This is currently used to show the enhanced tooltips.

Returns:
A list of pointers to item views used by the mode. The list can be empty.

Definition at line 133 of file BaseMode.cpp.


The documentation for this class was generated from the following files:
  • BaseMode.h
  • BaseMode.cpp

SystemSettingsView

Skip menu "SystemSettingsView"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •     Animators
  •     Applets
  •     Engines
  • Solid Modules
  • System Settings
  •   SystemSettingsView
Generated for API Reference by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal