creator/inc/creator_modulebase.h
changeset 0 d6fe6244b863
equal deleted inserted replaced
-1:000000000000 0:d6fe6244b863
       
     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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CREATOR_MODULEBASE_H__
       
    21 #define __CREATOR_MODULEBASE_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 // Dictionary uids for each Creator module.
       
    26 // Dictionaries are for storing item identifiers created by Creator.
       
    27 // Item identifiers are for enabling deletion of only items created by Creator. 
       
    28 const TUid KUidDictionaryUidContacts         = { 0x00 };
       
    29 const TUid KUidDictionaryUidContactGroups    = { 0x01 };
       
    30 const TUid KUidDictionaryUidCalendar         = { 0x02 };
       
    31 const TUid KUidDictionaryUidBrowserBookmarks = { 0x03 };
       
    32 const TUid KUidDictionaryUidFiles            = { 0x04 };
       
    33 const TUid KUidDictionaryUidLogs             = { 0x05 };
       
    34 const TUid KUidDictionaryUidMessages         = { 0x06 };
       
    35 const TUid KUidDictionaryUidMailbox          = { 0x07 };
       
    36 const TUid KUidDictionaryUidIAP              = { 0x08 };
       
    37 const TUid KUidDictionaryUidIMPS             = { 0x09 };
       
    38 const TUid KUidDictionaryUidNotes            = { 0x0A };
       
    39 const TUid KUidDictionaryUidLandmarks        = { 0x0B };
       
    40 const TUid KUidDictionaryUidBrowserSavedPg   = { 0x0C };
       
    41 const TUid KUidDictionaryUidBrowserBookmarkF = { 0x0D };
       
    42 const TUid KUidDictionaryUidBrowserSavedPgF  = { 0x0E };
       
    43 
       
    44 class CCreatorEngine;
       
    45 class MCreatorModuleBaseParameters;
       
    46 class CCommandParser;
       
    47 
       
    48 class MCreatorModuleBase
       
    49     {
       
    50 public:
       
    51 
       
    52 private:
       
    53     // constructs the module, add "iEngine = aEngine" and other construction stuff to the body
       
    54     virtual void ConstructL(CCreatorEngine* aEngine) = 0;
       
    55 
       
    56 public:
       
    57     // this one is called when user select some features directly from menu, not running a script
       
    58     // should call CreateRandomData() function
       
    59     // returns ETrue when success, EFalse when user has cancelled
       
    60     virtual TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries) = 0;
       
    61     virtual void DeleteAllL() = 0;
       
    62     virtual void DeleteAllCreatedByCreatorL() = 0;
       
    63 
       
    64 public:
       
    65     CCreatorEngine* iEngine;
       
    66 
       
    67 private:
       
    68 
       
    69     };
       
    70 
       
    71 
       
    72 class MCreatorModuleBaseParameters
       
    73     {
       
    74     // a base class for the parameters, no default implementation
       
    75     
       
    76     public:
       
    77     	enum TParseParams
       
    78     	{
       
    79     	EParamNone = 0,
       
    80     	ECalendarMeeting,
       
    81     	ECalendarMemo,
       
    82     	ECalendarAnniv,
       
    83     	ECalendarTodo
       
    84     	};
       
    85     
       
    86 public:
       
    87 	virtual void ParseL(CCommandParser* /*aParser*/, TParseParams /*aCase = 0*/) = 0;
       
    88 
       
    89 	
       
    90     };
       
    91     
       
    92 // Following struct represents the parameters that links for example contact groups
       
    93 // to contac-sets.
       
    94 typedef struct 
       
    95     {
       
    96     TInt iLinkId; // ID
       
    97     TInt iLinkAmount; // Amount of elements in linked set 
       
    98     } TLinkIdParam;
       
    99 
       
   100         
       
   101 class CCreatorModuleBaseParameters : public CBase, public MCreatorModuleBaseParameters
       
   102         {
       
   103         public:
       
   104         virtual void ParseL(CCommandParser* /*aParser*/, TParseParams /*aCase = 0*/){};
       
   105         virtual TInt ScriptLinkId() const {return -1;};
       
   106         virtual void SetScriptLinkId(TInt) {};
       
   107         // a base class for the parameters, no default implementation
       
   108         };
       
   109         
       
   110 
       
   111 
       
   112 
       
   113 #endif  // __CREATOR_MODULEBASE_H__
       
   114