calendarengines/calenlauncher/inc/CalenLauncherImpl.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2007 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:   Wrapper implementation class for launching S60 Calendar
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CALENLAUNCHERIMPL_H
       
    21 #define CALENLAUNCHERIMPL_H
       
    22 
       
    23 /**
       
    24 * Include files
       
    25 */
       
    26 #include <calentry.h>   // CCalEntry::TType
       
    27 
       
    28 /**
       
    29 * Class Declaration.
       
    30 * CCalenLauncherImpl is the implementation of CalenLauncher
       
    31 */
       
    32 NONSHARABLE_CLASS( CCalenLauncherImpl ) : public CBase
       
    33     {
       
    34     public:
       
    35         /**
       
    36          * First stage constructor
       
    37          * Creates an instance of CCalenLauncherImpl and places it
       
    38          * on the cleanup stack before passing ownership to the caller.
       
    39          */
       
    40     	static CCalenLauncherImpl* CCalenLauncherImpl::NewLC();
       
    41 
       
    42     	/**
       
    43          * Class destructor
       
    44          * Frees all resources used by this class
       
    45          */
       
    46     	~CCalenLauncherImpl();
       
    47 
       
    48         /**
       
    49          * Opens Calendar directly to the new entry editor.
       
    50          * Calendar will be closed when the editor is closed.
       
    51          * Any open dialogs (eg entry viewer or editor) will be closed.
       
    52          * @param aEntryType Type of entry editor to open
       
    53          */
       
    54         void NewEntryL( const CCalEntry::TType& aEntryType, TInt aFlag = 0 );
       
    55 
       
    56         /**
       
    57          * Opens a Calendar entry directly in the entry viewer.  If the
       
    58          * entry is a repeating entry then entire series will be opened.
       
    59          * The entry editor may be launched from the entry viewer.
       
    60          * Calendar will be closed when the viewer is closed.
       
    61          * Any open dialogs (eg entry viewer or editor) will be closed.
       
    62          * @param aLocalUid LocalUid of the entry to view
       
    63          */
       
    64         void ViewEntryL( const TCalLocalUid& aLocalUid );
       
    65 
       
    66         /**
       
    67          * Opens an instance of a repeating Calendar entry directly in the
       
    68          * entry viewer.
       
    69          * The entry editor may be launched from the entry viewer.
       
    70          * Calendar will be closed when the viewer is closed.
       
    71          * Any open dialogs (eg entry viewer or editor) will be closed.
       
    72          * @param aLocalUid LocalUid of the entry to view
       
    73          * @param aInstanceTime Instance time of the repeated entry
       
    74          */
       
    75         void ViewEntryL( const TCalLocalUid& aLocalUid, const TCalTime& aInstanceTime, TInt aFlags );
       
    76 
       
    77         /**
       
    78          * Opens an instance of a repeating Calendar entry directly in the
       
    79          * entry viewer.
       
    80          * The entry editor may be launched from the entry viewer.
       
    81          * Calendar will be closed when the viewer is closed.
       
    82          * Any open dialogs (eg entry viewer or editor) will be closed.
       
    83          * @param aLocalUid LocalUid of the entry to view
       
    84          * @param aCalFileName Calendar DB name of the repeated entry
       
    85          * @param aInstanceTime Instance time of the repeated entry
       
    86          */
       
    87         void ViewEntryL( const TCalLocalUid& aLocalUid, const TCalTime& aInstanceTime, const TDesC& aCalFileName, TInt aFlags );
       
    88 
       
    89         /**
       
    90          * Opens a Calendar entry directly in the entry editor.  If the
       
    91          * entry is a repeating entry then entire series will be opened.
       
    92          * Calendar will be closed when the editor is closed.
       
    93          * Any open dialogs (eg entry viewer or editor) will be closed.
       
    94          * @param aLocalUid LocalUid of the entry to view
       
    95          */
       
    96         void EditEntryL( const TCalLocalUid& aLocalUid );
       
    97 
       
    98         /**
       
    99          * Opens an instance of a repeating Calendar entry directly in the
       
   100          * entry editor.
       
   101          * Calendar will be closed when the editor is closed.
       
   102          * Any open dialogs (eg entry viewer or editor) will be closed.
       
   103          * @param aLocalUid LocalUid of the entry to view
       
   104          * @param aInstanceTime Instance time of the repeated entry
       
   105          */
       
   106         void EditEntryL( const TCalLocalUid& aLocalUid, const TCalTime& aInstanceTime );
       
   107 
       
   108         /**
       
   109          * Launches Calendar in the specified view.
       
   110          * If Calendar is already running it will be brought to the foreground
       
   111          * in the specified view.
       
   112          * Any open dialogs (eg entry viewer or editor) will be closed.
       
   113          * @param aViewUid UID of the Calendar view to use.
       
   114          */
       
   115         void LaunchL( const TUid& aViewUid );
       
   116 
       
   117         /**
       
   118          * Launches Calendar in the specified view, focused to the specified time
       
   119          * If Calendar is already running it will be brought to the foreground
       
   120          * in the specified view.
       
   121          * Any open dialogs (eg entry viewer or editor) will be closed.
       
   122          * @param aViewUid UID of the Calendar view to use.
       
   123 		 * @param aInstanceTime Initial focus time
       
   124          */
       
   125         void LaunchL( const TUid& aViewUid, const TCalTime& aInstanceTime );
       
   126 
       
   127 	private:
       
   128 		/**
       
   129 		 * Private constructor
       
   130 		 */
       
   131 		CCalenLauncherImpl();
       
   132 
       
   133 		/**
       
   134 		 * Second stage constructor
       
   135 		 * Performs any leaving operations needed for construction.
       
   136 		 */
       
   137 		void ConstructL();
       
   138 
       
   139         /**
       
   140         * AddLaunchParamL
       
   141         * Adds a parameter to the unicode launch string
       
   142         * @param aLaunchParam Parameter to add
       
   143         */
       
   144         void AddLaunchParamL( const TDesC& aLaunchParam );
       
   145 
       
   146         /**
       
   147         * AddTimeParamL
       
   148         * Expands a TCalTime and adds the individual components to the
       
   149         * unicode launch string.
       
   150         * @param aCalTime Time to add.
       
   151         */
       
   152         void AddTimeParamL( const TCalTime& aCalTime );
       
   153 
       
   154         /**
       
   155         * AddUidParamL
       
   156         * Adds a local uid to the unicode launch string.
       
   157         * @param aLocalUid Uid to add.
       
   158         */
       
   159         void AddUidParamL( const TCalLocalUid& aLocalUid );
       
   160 
       
   161         /**
       
   162         * AddViewUidParamL
       
   163         * Adds a view uid to the unicode launch string as a command.
       
   164         * @param aViewUid Uid to add.
       
   165         */
       
   166         void AddViewUidParamL( const TUid& aViewUid );
       
   167 
       
   168         /**
       
   169         * ConvertLaunchParamsFromUnicodeL
       
   170         * Sets the launch parameters to be passed through to Calendar
       
   171         */
       
   172         void ConvertLaunchParamsFromUnicodeL();
       
   173 
       
   174         /**
       
   175         * LaunchAppL
       
   176         * Starts Calendar with command line parameters.  This will call
       
   177         * TApaTask::SendMessage if Calendar is running, or launch Calendar normally.
       
   178         * Either way, the command line parameters will end up in
       
   179         * CCalenAppUi::ProcessCommandParametersL
       
   180         */
       
   181         void LaunchAppL();
       
   182 
       
   183         /**
       
   184         * AddFlagParamL
       
   185         * Adds a parameter to the unicode launch string
       
   186         * @param aFlag Parameter to add
       
   187         */
       
   188         void AddFlagParamL( TInt aFlag );
       
   189 
       
   190     private:
       
   191         HBufC* iLaunchUnicode;
       
   192         HBufC8* iLaunchParams;
       
   193 
       
   194     };
       
   195 
       
   196 #endif // __CALENLAUNCHERIMPL_H__
       
   197 
       
   198 // End of File