wvuing/wvuiprocess/Inc/CCARecordedChatsPC.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Process Manager to get process interfaces e.g. login,settings
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef  CCARECORDEDCHATSPC_H
       
    19 #define  CCARECORDEDCHATSPC_H
       
    20 
       
    21 #include "MCARecordedChatsPC.h"
       
    22 #include "MCALoggerHeadersInterface.h"
       
    23 #include "MCAMessageRWInterfacePC.h"
       
    24 
       
    25 //Forward Declaration
       
    26 class CIdle;
       
    27 class CSendUi;
       
    28 class RWriteStream;
       
    29 class MCARecordedChatsArrayPC;
       
    30 class MCAMessagesWriteInterface;
       
    31 class MCAMessagesReadInterface;
       
    32 class CEikonEnv;
       
    33 //Class declaration
       
    34 class CCARecordedChatsPC: public CBase,
       
    35             public MCARecordedChatsPC,
       
    36             public MCAMessageRWInterfacePC
       
    37     {
       
    38     public:
       
    39 
       
    40         /**
       
    41         * Two-phased constructor.
       
    42         */
       
    43         static CCARecordedChatsPC* NewL( MCALoggerHeadersInterface& iLoggerHeadersInterface,
       
    44                                          MCARecordedChatsArrayPC& aRecordedChatsArrayPC );
       
    45 
       
    46     public:
       
    47 
       
    48         /**
       
    49          *	Destructor
       
    50          */
       
    51         ~CCARecordedChatsPC();
       
    52 
       
    53     public: //From MCARecordedChatsPC
       
    54 
       
    55         /**
       
    56         * Delete one history file recognized by index.
       
    57         * @return true if the file has been deleted else return false
       
    58         */
       
    59         virtual TBool DeleteHistoryFileL( );
       
    60 
       
    61 
       
    62         /**
       
    63         * Deletes message container of current recorded chat
       
    64         * from engine. Used to free memory when exiting current
       
    65         * recorded chat view i.e. called from DoDeactivate method
       
    66         * of view class.
       
    67         */
       
    68         virtual void DeleteRecordedChatContainerL();
       
    69 
       
    70         /**
       
    71         * Initialize/unitialize selected items array pointer
       
    72         * @param aArray Pointer to selected items array.
       
    73         */
       
    74         virtual void SetSelectedItems( const CArrayFix< TInt >* aArray );
       
    75 
       
    76         /**
       
    77         * Return whether there are selected items
       
    78         * @param true if there is atleast one valid item selected else return false
       
    79         */
       
    80         virtual TBool ValidSelectedItems() const;
       
    81 
       
    82         /**
       
    83         * return the number of selected items
       
    84         * @Return an integer: count of selected items
       
    85         */
       
    86         virtual TInt SelectedItemsCount() const;
       
    87 
       
    88         /**
       
    89         * Prepares array for sending MTMs.
       
    90         */
       
    91         virtual void PrepareArrayForSendingMtmL();
       
    92 
       
    93         /**
       
    94         * Is index item marked or not
       
    95         * @param aIndex Item which marked status is returned
       
    96         * @return ETrue if item is marked, EFalse if not.
       
    97         */
       
    98         virtual TBool IsMarked( TInt aIndex );
       
    99 
       
   100         /**
       
   101         * Initialize array for deletion. Sort is from back to start.
       
   102         */
       
   103         virtual void InitDeleteArrayL();
       
   104 
       
   105         /**
       
   106         * Method is used to launch MTM editor with given targetUid
       
   107         * @param aTargetUid id for MTM editor to be launched.
       
   108         * @param aIndex Message index which to send.
       
   109         */
       
   110         // Code Scanner warning to be ignored
       
   111         virtual TInt SendMTML( TInt aIndex, TUid aTargetUid /*= KNullUid*/ );
       
   112 
       
   113 
       
   114 
       
   115         /**
       
   116         * Delete history files. If there is marked items those are deleted.
       
   117         * Otherwise item which index is given is deleted.
       
   118         * @param aIndex Item index
       
   119         * @return ETrue, if deletion is ok to start, EFalse if not.
       
   120         */
       
   121         virtual void DeleteHistoryFilesL( TInt aIndex, TBool aDeleteCurrentChat );
       
   122 
       
   123         /**
       
   124         * Check filename for MTM messages and correct
       
   125         * it to unique if it is not.
       
   126         * @param aFilename Proposed filename and corrected after checking.
       
   127         * @param aArray Array of already existing filenames.
       
   128         */
       
   129         virtual void CheckAndCorrectMtmFilename( TFileName& aFilename,
       
   130                                                  MDesCArray& aArray );
       
   131 
       
   132         /**
       
   133         * Get the number of stored contacts in all the lists
       
   134         * @return integer: number of stored contacts
       
   135         */
       
   136         virtual TInt StoredContactsCount() const;
       
   137 
       
   138         /**
       
   139         * To return the number of groups
       
   140         * @return integer: count of groups
       
   141         */
       
   142         virtual TInt GroupCountL( TBool aGroupsSupported ) const;
       
   143 
       
   144         /**
       
   145         * To populate the two arrays of group names and goup ids
       
   146         * @param aGroupNames: array of the current group names
       
   147         * @param aGroupIds: array of the current group IDs
       
   148         */
       
   149         virtual MCAServerContactsArrayPC* GetPairArrayForServerContactsArrayLC();
       
   150 
       
   151         /**
       
   152         * Get message for sending it via MTM
       
   153         * @param aIndex Index of message to send
       
   154         * @param aStream Stream where message is written.
       
   155         */
       
   156         virtual void GetMessageForSendingViaMTML(
       
   157             TInt aIndex, RWriteStream& aStream );
       
   158 
       
   159 
       
   160         //fix - refer Ui Spec Approved Version 1.0 (Instant Messaging NG 001 151006.pdf)
       
   161         //Section 10.2.10 Pg 131 -
       
   162         //"In case user has saved the image already or sent it by himself,
       
   163         // this option(save) is not available."
       
   164         /**
       
   165          * ReLoggingL
       
   166          * @since series 60  v3.2
       
   167          * @return void
       
   168          */
       
   169         virtual void ReLoggingL();
       
   170 
       
   171         /**
       
   172          * reset enginer loggers..for reading from different drive....
       
   173          * @since series 60  v3.2
       
   174          * @return void
       
   175          */
       
   176         void ResetEngineLoggerL();
       
   177 
       
   178     public://From MCAMessageRWInterfacePC
       
   179         /*
       
   180         * @see MCAMessageRWInterfacePC
       
   181         */
       
   182         virtual MCAMessagesReadInterface& ReadInterfaceL() const;
       
   183 
       
   184         /*
       
   185         * @see MCAMessageRWInterfacePC
       
   186         */
       
   187         virtual MCAMessagesWriteInterface& WriteInterfaceL() const;
       
   188 
       
   189 
       
   190     private: //Private Constructors
       
   191         /**
       
   192         * private default constructor
       
   193         * @param aLoggerHeadersInterface: Reference to the logger component
       
   194         * @param aRecordedChatsArrayPC: Reference to the Recorded chats
       
   195         *								array process component
       
   196         */
       
   197         CCARecordedChatsPC( MCALoggerHeadersInterface& aLoggerHeadersInterface,
       
   198                             MCARecordedChatsArrayPC& aRecordedChatsArrayPC );
       
   199 
       
   200         /**
       
   201         * Symbian 2nd phase constructor.
       
   202         */
       
   203         void ConstructL();
       
   204 
       
   205     private: //Data memebers
       
   206 
       
   207 
       
   208         /**
       
   209         * Reference to the MCALoggerHeadersInterface in the engine component
       
   210         */
       
   211         MCALoggerHeadersInterface& iLoggerHeadersInterface;
       
   212 
       
   213         /**
       
   214         * reference to MCARecordedChatsArrayPC
       
   215         */
       
   216         MCARecordedChatsArrayPC& iRecordedChatsArrayPC;
       
   217 
       
   218         // Owns. For sending messages via MTM
       
   219         CSendUi* iSendAppUi;
       
   220 
       
   221 
       
   222         // Owns. History temp directory;
       
   223         HBufC* iHistoryTempDir;
       
   224 
       
   225         // Does not own. Selected items array.
       
   226         const CArrayFix< TInt >* iSelectedItems;
       
   227 
       
   228         // Owns: Temp array for keeping track of deleted files
       
   229         RArray< TInt > iItemsForDeletion;
       
   230 
       
   231         CEikonEnv* iEikonEn;
       
   232 
       
   233     };
       
   234 
       
   235 #endif //CCARECORDEDCHATSPC_H
       
   236