Fix forward navigation control on Linux.
[dorian] / widgets / mediakeysobserver.h
1 /****************************************************************************\r
2 **\r
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).\r
4 ** All rights reserved.\r
5 ** Contact: Nokia Corporation (qt-info@nokia.com)\r
6 **\r
7 ** This file is part of the Qt Mobility Components.\r
8 **\r
9 ** $QT_BEGIN_LICENSE:BSD$\r
10 ** You may use this file under the terms of the BSD license as follows:\r
11 **\r
12 ** "Redistribution and use in source and binary forms, with or without\r
13 ** modification, are permitted provided that the following conditions are\r
14 ** met:\r
15 **   * Redistributions of source code must retain the above copyright\r
16 **     notice, this list of conditions and the following disclaimer.\r
17 **   * Redistributions in binary form must reproduce the above copyright\r
18 **     notice, this list of conditions and the following disclaimer in\r
19 **     the documentation and/or other materials provided with the\r
20 **     distribution.\r
21 **   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor\r
22 **     the names of its contributors may be used to endorse or promote\r
23 **     products derived from this software without specific prior written\r
24 **     permission.\r
25 **\r
26 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
27 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
28 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
29 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
30 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
31 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
32 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
33 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
34 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
35 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
36 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."\r
37 ** $QT_END_LICENSE$\r
38 **\r
39 ****************************************************************************/\r
40 \r
41 #ifndef MEDIAKEYSOBSERVER_H_\r
42 #define MEDIAKEYSOBSERVER_H_\r
43 \r
44 #include <remconcoreapitargetobserver.h>\r
45 #include <remconcoreapitarget.h>\r
46 #include <remconinterfaceselector.h>\r
47 #include <aknappui.h>\r
48 #include <QObject>\r
49 \r
50 class MediaKeysObserver : public QObject, public MRemConCoreApiTargetObserver\r
51 {\r
52     Q_OBJECT\r
53 \r
54 public:\r
55     enum MediaKeys {\r
56         EVolIncKey,\r
57         EVolDecKey,\r
58         EPlayPauseKey,\r
59         EStopKey,\r
60         EBackwardKey,\r
61         EForwardKey,\r
62         EFastForwardKey,\r
63         EFastRewindKey\r
64     };\r
65 \r
66     static MediaKeysObserver *instance();\r
67     static void close();\r
68 \r
69 protected:\r
70     MediaKeysObserver(QObject *parent = 0);\r
71     virtual ~MediaKeysObserver();\r
72     void MrccatoCommand(TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction aButtonAct);\r
73     void MrccatoPlay(TRemConCoreApiPlaybackSpeed /*aSpeed*/, TRemConCoreApiButtonAction /*aButtonAct*/) {}\r
74     void MrccatoTuneFunction(TBool /*aTwoPart*/, TUint /*aMajorChannel*/, TUint /*aMinorChannel*/, TRemConCoreApiButtonAction /*aButtonAct*/) {}\r
75     void MrccatoSelectDiskFunction(TUint /*aDisk*/, TRemConCoreApiButtonAction /*aButtonAct*/) {}\r
76     void MrccatoSelectAvInputFunction(TUint8 /*aAvInputSignalNumber*/, TRemConCoreApiButtonAction /*aButtonAct*/) {}\r
77     void MrccatoSelectAudioInputFunction(TUint8 /*aAudioInputSignalNumber*/, TRemConCoreApiButtonAction /*aButtonAct*/) {}\r
78 \r
79 Q_SIGNALS:\r
80     void mediaKeyPressed(MediaKeysObserver::MediaKeys key);\r
81 \r
82 private:\r
83     CRemConInterfaceSelector* iInterfaceSelector;\r
84     CRemConCoreApiTarget*     iCoreTarget;\r
85 };\r
86 #endif\r