26 { |
26 { |
27 const char gShortcutId[] = "caEntryId"; |
27 const char gShortcutId[] = "caEntryId"; |
28 const char gShortcutWidgetUri[] = "hsshortcutwidgetplugin"; |
28 const char gShortcutWidgetUri[] = "hsshortcutwidgetplugin"; |
29 } |
29 } |
30 |
30 |
|
31 |
|
32 /*! |
|
33 \class HsShortcutService |
|
34 \ingroup group_hsdomainmodel |
|
35 \brief |
|
36 */ |
|
37 |
|
38 /*! |
|
39 |
|
40 */ |
31 HsShortcutServicePrivate::HsShortcutServicePrivate(QStateMachine *stateMachine, QObject *parent) |
41 HsShortcutServicePrivate::HsShortcutServicePrivate(QStateMachine *stateMachine, QObject *parent) |
32 : QObject(parent), |
42 : QObject(parent), |
33 mStateMachine(stateMachine) |
43 mStateMachine(stateMachine) |
34 { |
44 { |
35 } |
45 } |
36 |
46 |
|
47 /*! |
|
48 |
|
49 */ |
37 HsShortcutServicePrivate::~HsShortcutServicePrivate() |
50 HsShortcutServicePrivate::~HsShortcutServicePrivate() |
38 { |
51 { |
39 |
52 |
40 } |
53 } |
41 |
54 |
|
55 /*! |
|
56 |
|
57 */ |
42 void HsShortcutServicePrivate::executeCollectionAction( |
58 void HsShortcutServicePrivate::executeCollectionAction( |
43 int shortcutId, const QString& collectionType) |
59 int shortcutId, const QString& collectionType) |
44 { |
60 { |
45 QEvent *menuEvent = HsMenuEventFactory:: |
61 QEvent *menuEvent = HsMenuEventFactory:: |
46 createOpenCollectionEvent(shortcutId, collectionType); |
62 createOpenCollectionEvent(shortcutId, collectionType); |
47 mStateMachine->postEvent(menuEvent); |
63 mStateMachine->postEvent(menuEvent); |
48 } |
64 } |
49 |
65 |
|
66 /*! |
|
67 |
|
68 */ |
50 bool HsShortcutServicePrivate::isItemShortcutWidget(int itemId) |
69 bool HsShortcutServicePrivate::isItemShortcutWidget(int itemId) |
51 { |
70 { |
52 HsDatabase *db = HsDatabase::instance(); |
71 HsDatabase *db = HsDatabase::instance(); |
53 Q_ASSERT(db); |
72 Q_ASSERT(db); |
54 |
73 |
63 } |
82 } |
64 } |
83 } |
65 return false; |
84 return false; |
66 } |
85 } |
67 |
86 |
|
87 /*! |
|
88 |
|
89 */ |
68 HsShortcutService *HsShortcutService::instance(QStateMachine *stateMachine) |
90 HsShortcutService *HsShortcutService::instance(QStateMachine *stateMachine) |
69 { |
91 { |
70 if (!mInstance && stateMachine) { |
92 if (!mInstance && stateMachine) { |
71 mInstance = new HsShortcutService(stateMachine); |
93 mInstance = new HsShortcutService(stateMachine); |
72 } |
94 } |
73 return mInstance; |
95 return mInstance; |
74 } |
96 } |
75 |
97 |
|
98 /*! |
|
99 |
|
100 */ |
76 HsShortcutService::~HsShortcutService() |
101 HsShortcutService::~HsShortcutService() |
77 { |
102 { |
|
103 |
78 } |
104 } |
79 |
105 |
|
106 /*! |
|
107 |
|
108 */ |
80 void HsShortcutService::executeCollectionAction( |
109 void HsShortcutService::executeCollectionAction( |
81 int shortcutId, const QString& collectionType) |
110 int shortcutId, const QString& collectionType) |
82 { |
111 { |
83 mD->executeCollectionAction(shortcutId, collectionType); |
112 mD->executeCollectionAction(shortcutId, collectionType); |
84 } |
113 } |
85 |
114 |
|
115 /*! |
|
116 |
|
117 */ |
86 bool HsShortcutService::isItemShortcutWidget(int itemId) |
118 bool HsShortcutService::isItemShortcutWidget(int itemId) |
87 { |
119 { |
88 return mD->isItemShortcutWidget(itemId); |
120 return mD->isItemShortcutWidget(itemId); |
89 } |
121 } |
90 |
122 |
|
123 /*! |
|
124 |
|
125 */ |
91 HsShortcutService::HsShortcutService(QStateMachine *stateMachine, QObject *parent) |
126 HsShortcutService::HsShortcutService(QStateMachine *stateMachine, QObject *parent) |
92 : QObject(parent) |
127 : QObject(parent) |
93 { |
128 { |
94 mD.reset(new HsShortcutServicePrivate(stateMachine)); |
129 mD.reset(new HsShortcutServicePrivate(stateMachine)); |
95 } |
130 } |