src/hbservers/hbthemeserver/hbthemeserverapplication_p.h
changeset 2 06ff229162e9
child 3 11d3954df52a
equal deleted inserted replaced
1:f7ac710697a9 2:06ff229162e9
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (developer.feedback@nokia.com)
       
     6 **
       
     7 ** This file is part of the HbServers module of the UI Extensions for Mobile.
       
     8 **
       
     9 ** GNU Lesser General Public License Usage
       
    10 ** This file may be used under the terms of the GNU Lesser General Public
       
    11 ** License version 2.1 as published by the Free Software Foundation and
       
    12 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
       
    13 ** Please review the following information to ensure the GNU Lesser General
       
    14 ** Public License version 2.1 requirements will be met:
       
    15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    16 **
       
    17 ** In addition, as a special exception, Nokia gives you certain additional
       
    18 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    20 **
       
    21 ** If you have questions regarding the use of this file, please contact
       
    22 ** Nokia at developer.feedback@nokia.com.
       
    23 **
       
    24 ****************************************************************************/
       
    25 #ifndef HBTHEMESERVERAPPLICATION_P_H
       
    26 #define HBTHEMESERVERAPPLICATION_P_H
       
    27 
       
    28 #include <QtSingleApplication>
       
    29 
       
    30 class HbThemeServer;
       
    31 
       
    32 class HbThemeServerApplication : public QtSingleApplication
       
    33 {
       
    34     Q_OBJECT
       
    35 
       
    36 public:
       
    37     HbThemeServerApplication(int &argc, char *argv[]);
       
    38     ~HbThemeServerApplication();
       
    39 
       
    40     struct Options {
       
    41         static bool help;
       
    42         static bool start;
       
    43         static bool stop;
       
    44         static bool persistent;
       
    45         static QString error;
       
    46     };
       
    47 
       
    48     bool initialize();
       
    49     int exec();
       
    50     
       
    51     static bool acquireLock();
       
    52 
       
    53 public slots:
       
    54     void stop();
       
    55 
       
    56 private slots:
       
    57     void receiveMessage(const QString &message);
       
    58 
       
    59 private:
       
    60     bool loadLibrary(const QString &name);
       
    61 
       
    62     HbThemeServer *server;
       
    63 };
       
    64 
       
    65 #ifdef Q_OS_SYMBIAN
       
    66 #include <f32file.h>
       
    67 class Lock
       
    68 {
       
    69 public:
       
    70     enum State {
       
    71         Reserved,
       
    72         Acquired,
       
    73         Error
       
    74     };
       
    75     Lock();
       
    76     ~Lock(){close();}
       
    77     void close(){mFile.Close(); mFs.Close();}
       
    78     State acquire();
       
    79     static bool serverExists();
       
    80 
       
    81 private:
       
    82     RFs mFs;
       
    83     RFile mFile;
       
    84 };
       
    85 #endif
       
    86 
       
    87 #endif // HBTHEMESERVERAPPLICATION_P_H