not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / khotkeys / libkhotkeysprivate / triggers / trigger.cpp
blob6735c1e73db0344d3832ec56b7b4801a01c7a442
1 /*
2 Copyright (C) 1999-2001 Lubos Lunak <l.lunak@kde.org>
3 Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library 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 GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #include "triggers.h"
22 #include <KDE/KConfigGroup>
23 #include <KDE/KDebug>
25 namespace KHotKeys {
27 Trigger::Trigger( ActionData* data_P )
28 : data( data_P )
33 Trigger::Trigger( KConfigGroup&, ActionData* data_P )
34 : data( data_P )
39 Trigger::~Trigger()
44 void Trigger::aboutToBeErased()
48 void Trigger::cfg_write( KConfigGroup& cfg_P ) const
50 cfg_P.writeEntry( "Type", "ERROR" );
54 Trigger* Trigger::create_cfg_read( KConfigGroup& cfg_P, ActionData* data_P )
56 QString type = cfg_P.readEntry( "Type" );
57 if( type == "SHORTCUT" || type == "SINGLE_SHORTCUT" )
58 return new ShortcutTrigger( cfg_P, data_P );
59 if( type == "WINDOW" )
60 return new WindowTrigger( cfg_P, data_P );
61 if( type == "GESTURE" )
62 return new GestureTrigger(cfg_P, data_P );
63 // FIXME: SOUND
64 #if 0
65 if( type == "VOICE" )
66 return new Voice_trigger (cfg_P, data_P );
67 #endif
69 kWarning() << "Unknown Trigger type read from cfg file\n";
70 return NULL;
74 } // namespace KHotKeys