videocollection/videocollectionview/inc/videooperatorservice_p.h
changeset 55 4bfa887905cf
child 67 72c709219fcd
equal deleted inserted replaced
50:21fe8338c6bf 55:4bfa887905cf
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   VideoOperatorServicePrivate class declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef VIDEOOPERATORSERVICEPRIVATE_H
       
    19 #define VIDEOOPERATORSERVICEPRIVATE_H
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <qobject.h>
       
    23 #include <qprocess.h>
       
    24 #include <e32cmn.h>
       
    25 
       
    26 class VideoOperatorService;
       
    27 
       
    28 /**
       
    29  * Private functionality for loading and launching operator customisable services.
       
    30  */
       
    31 class VideoOperatorServicePrivate : public QObject
       
    32 {
       
    33     Q_OBJECT
       
    34 
       
    35     Q_DISABLE_COPY(VideoOperatorServicePrivate)
       
    36     
       
    37 public:
       
    38 
       
    39     /**
       
    40      * Contructor.
       
    41      *
       
    42      * @param ptr pointer to public implementation
       
    43      */
       
    44     VideoOperatorServicePrivate();
       
    45 
       
    46     /**
       
    47      * Destructor.
       
    48      *
       
    49      */
       
    50     ~VideoOperatorServicePrivate();
       
    51     
       
    52     /**
       
    53      * Loads the service.
       
    54      * 
       
    55      * @titleKey Central Repository key id for the service's title.
       
    56      * @iconKey Central Repository key id for the service's icon resource.
       
    57      * @uriKey Central Repository key id for the service's URI.
       
    58      * @uidKey Central Repository key id for the service's UID.
       
    59      * 
       
    60      * @return True if service was loaded succesfully.
       
    61      */
       
    62     bool load(int titleKey, int iconKey, int uriKey, int uidKey);
       
    63 
       
    64     /**
       
    65      * Returns name for the service.
       
    66      * 
       
    67      * @return name of the service.
       
    68      */
       
    69     const QString title() const;
       
    70     
       
    71     /**
       
    72      * Returns the icon resource for the service.
       
    73      * 
       
    74      * @return path or resource id to the icon.
       
    75      */
       
    76     const QString iconResource() const;
       
    77     
       
    78     /**
       
    79      * Launches the service.
       
    80      */
       
    81     void launchService();
       
    82 
       
    83 private:
       
    84     
       
    85     /**
       
    86      * Gets filename including path.
       
    87      * 
       
    88      * @param TUid application UID.
       
    89      * 
       
    90      * @return string application full filename.
       
    91      */
       
    92     QString getApplicationFilenameL(const TUid uid);
       
    93 
       
    94     /**
       
    95      * Bring application to foreground. 
       
    96      * 
       
    97      * @param TUid application UID.
       
    98      * 
       
    99      * @return bool true if application was brought to foreground, else false.
       
   100      */
       
   101     bool bringApplicationToForeground(const TUid uid);
       
   102 
       
   103     /**
       
   104      * Starts the application. 
       
   105      * 
       
   106      * @param TUid application UID.
       
   107      */
       
   108     void startApplicationL(const TUid uid);
       
   109     
       
   110 public slots:
       
   111     
       
   112     /**
       
   113      * Signaled when process has finished. Brings videos application back to foreground.
       
   114      */    
       
   115     void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
       
   116     
       
   117     /**
       
   118      * Signaled if there's error with the process. 
       
   119      */
       
   120     void processError(QProcess::ProcessError error);
       
   121 
       
   122 private:
       
   123     
       
   124     /**
       
   125      * Title for the service.
       
   126      */
       
   127     QString mTitle;
       
   128     
       
   129     /**
       
   130      * Icon for the service.
       
   131      */
       
   132     QString mIconResource;
       
   133     
       
   134     /**
       
   135      * Service URL if service should launch an URL.
       
   136      */
       
   137     QString mServiceUri;
       
   138     
       
   139     /**
       
   140      * Application UID if service should launch an external application.  
       
   141      */
       
   142     int mApplicationUid;
       
   143     
       
   144     /**
       
   145      * Pointer to started process.
       
   146      */
       
   147     QProcess *mProcess;
       
   148 };
       
   149 
       
   150 #endif // VIDEOOPERATORSERVICEPRIVATE_H
       
   151 
       
   152 // End of file.