• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

kremotecontrol

  • sources
  • kde-4.12
  • kdeutils
  • kremotecontrol
  • libkremotecontrol
executionengine.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) <2009> <Frank Scheffold (fscheffold@googlemail.com)>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 
18 */
19 
20 #include "executionengine.h"
21 #include "dbusactionexecutor.h"
22 #include "keypressactionexecutor.h"
23 #include "kremotecontrol_export.h"
24 
25 #include <kglobal.h>
26 #include <kdebug.h>
27 
28 #include <QtCore/QMap>
29 
30 class ExecutionEnginePrivate
31 {
32  public:
33  ExecutionEnginePrivate();
34 
35  QMap<Action::ActionType, ActionExecutor*> executors;
36 
37 };
38 
39 K_GLOBAL_STATIC(ExecutionEnginePrivate, executionEnginePrivate)
40 
41 ExecutionEnginePrivate::ExecutionEnginePrivate() {
42  DBusActionExecutor *dbusExecutor = new DBusActionExecutor();
43  executors.insert(Action::DBusAction, dbusExecutor);
44  // ProfileActions are DBusActions with additional Information. They can be handled by the DBusExecutor
45  executors.insert(Action::ProfileAction, dbusExecutor);
46  KeypressActionExecutor *keypressActionExecutor = new KeypressActionExecutor();
47  executors.insert(Action::KeypressAction, keypressActionExecutor);
48 }
49 
50 void KREMOTECONTROL_EXPORT ExecutionEngine::executeAction(Action* action) {
51  ActionExecutor *executor = executionEnginePrivate->executors.value(action->type());
52  if(executor != 0){
53  executor->execute(action);
54  } else {
55  kDebug() << "No Executor found for actiontype" << action->type();
56  }
57 }
kremotecontrol_export.h
Action::type
ActionType type() const
Definition: action.cpp:33
ExecutionEngine::executeAction
void executeAction(Action *action)
Definition: executionengine.cpp:50
keypressactionexecutor.h
KREMOTECONTROL_EXPORT
#define KREMOTECONTROL_EXPORT
Definition: kremotecontrol_export.h:37
ActionExecutor
Definition: actionexecutor.h:25
Action::KeypressAction
Definition: action.h:33
Action
Definition: action.h:30
dbusactionexecutor.h
Action::DBusAction
Definition: action.h:33
Action::ProfileAction
Definition: action.h:33
executionengine.h
KeypressActionExecutor
Definition: keypressactionexecutor.h:30
DBusActionExecutor
Definition: dbusactionexecutor.h:25
ActionExecutor::execute
virtual void execute(Action *action)=0
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:07:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kremotecontrol

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

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal