src/hbservers/hbthemeserver/hbthemeserverapplication_p.h
changeset 7 923ff622b8b9
parent 3 11d3954df52a
child 21 4633027730f5
equal deleted inserted replaced
6:c3690ec91ef8 7:923ff622b8b9
    45         static QString error;
    45         static QString error;
    46     };
    46     };
    47 
    47 
    48     bool initialize();
    48     bool initialize();
    49     int exec();
    49     int exec();
    50     
       
    51     static bool acquireLock();
       
    52     static void setPriority();
    50     static void setPriority();
    53 
    51 
    54 public slots:
    52 public slots:
    55     void stop();
    53     void stop();
    56 
    54 
    72         Reserved,
    70         Reserved,
    73         Acquired,
    71         Acquired,
    74         Error
    72         Error
    75     };
    73     };
    76     Lock();
    74     Lock();
    77     ~Lock(){close();}
    75     ~Lock(){
       
    76         close();
       
    77     }
    78     void close()
    78     void close()
    79     {
    79     {
    80         mFile.Close();
    80         mFile.Close();
    81         mFs.Close();
    81         mFs.Close();
    82     }
    82     }
    83     State acquire();
    83     State acquire();
    84     static bool serverExists();
       
    85 
    84 
    86 private:
    85 private:
    87     RFs mFs;
    86     RFs mFs;
    88     RFile mFile;
    87     RFile mFile;
    89 };
    88 };
    90 #endif
    89 #endif
    91 
    90 
       
    91 // Guard against starting multiple copies of the server
       
    92 class HbThemeServerLocker
       
    93 {
       
    94 public:
       
    95     HbThemeServerLocker() {}
       
    96     bool lock();
       
    97 private:
       
    98     static bool serverExists();
       
    99 private:
       
   100 #ifdef Q_OS_SYMBIAN
       
   101     Lock mLock;
       
   102 #endif
       
   103 };
       
   104 
    92 #endif // HBTHEMESERVERAPPLICATION_P_H
   105 #endif // HBTHEMESERVERAPPLICATION_P_H