memspyui/ui/avkon/inc/MemSpyViewMemoryTrackingAutoStartConfig.h
branchRCL_3
changeset 19 b3cee849fa46
equal deleted inserted replaced
18:48060abbbeaf 19:b3cee849fa46
       
     1 /*
       
     2 * Copyright (c) 2009 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 #ifndef MEMSPYVIEWMEMORYTRACKINGAUTOSTARTCONFIG_H
       
    19 #define MEMSPYVIEWMEMORYTRACKINGAUTOSTARTCONFIG_H
       
    20 
       
    21 // System includes
       
    22 #include <coecntrl.h>
       
    23 #include <aknlists.h>
       
    24 #include <ecom/ecom.h>
       
    25 #include <xml/contenthandler.h> // MContentHandler mix in class
       
    26 #include <xml/parser.h>
       
    27 
       
    28 // User includes
       
    29 #include "MemSpyViewBase.h"
       
    30 
       
    31 // Literal constants
       
    32 _LIT( KMemSpyProcessMemoryTrackingAutoStartConfigSearchPath, "E:\\MemSpy\\" );
       
    33 _LIT( KMemSpyProcessMemoryTrackingAutoStartConfigFileName, "MemSpyProcessMemoryTrackingAutoStartConfig.xml" );
       
    34 
       
    35 // Classes referenced
       
    36 class CCnvCharacterSetConverter;
       
    37 
       
    38 // Namespaces referenced
       
    39 using namespace Xml;
       
    40 
       
    41 
       
    42 class CMemSpyViewMemoryTrackingAutoStartConfig : public CMemSpyViewBase, public MContentHandler
       
    43     {
       
    44 public:
       
    45     CMemSpyViewMemoryTrackingAutoStartConfig( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
       
    46     ~CMemSpyViewMemoryTrackingAutoStartConfig();
       
    47     void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
       
    48 
       
    49 public: // From CMemSpyViewBase
       
    50     TMemSpyViewType ViewType() const;
       
    51     CMemSpyViewBase* PrepareParentViewL();
       
    52     TBool HandleCommandL( TInt aCommand );
       
    53     void HandleListBoxItemActionedL( TInt aIndex );
       
    54     void SetListBoxModelL();
       
    55     void RefreshL();
       
    56 
       
    57 public: // Menu framework
       
    58     void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
    59     TUint MenuCascadeResourceId() const;
       
    60     TInt MenuCascadeCommandId() const;
       
    61 
       
    62 private: // Command handlers
       
    63     void OnCmdItemAddL();
       
    64     void OnCmdItemEditL();
       
    65     void OnCmdItemDeleteL();
       
    66     void OnCmdItemDeleteAllL();
       
    67     void OnCmdItemImportL();
       
    68 
       
    69 private: // Internal methods
       
    70     TUid ShowDialogL( TUid aUid );
       
    71     void SaveChangesL();
       
    72     static TUid ValidateProcessUid( const TDesC& aUid );
       
    73 
       
    74 private: // Internal XML methods
       
    75     void FindXmlInstallTimeL();
       
    76     void FindXmlUserSuppliedL();
       
    77     HBufC* FindEComXmlFileNameLC();
       
    78     void ConvertL( const TDesC8& aInput, TDes16& aOutput );
       
    79     void ParseL( const TDesC& aFileName );
       
    80 
       
    81 private: // XML helper functions
       
    82     void OnSectionProcessL( const RAttributeArray& aAttributes );
       
    83 
       
    84 private: // From MContentHandler
       
    85 	void OnStartDocumentL( const RDocumentParameters& aDocParam, TInt aErrorCode );
       
    86 	void OnEndDocumentL( TInt aErrorCode );
       
    87 	void OnStartElementL( const RTagInfo& aElement, const RAttributeArray& aAttributes, TInt aErrorCode );
       
    88 	void OnEndElementL( const RTagInfo& aElement, TInt aErrorCode );
       
    89 	void OnContentL( const TDesC8& aBytes, TInt aErrorCode );
       
    90 	void OnStartPrefixMappingL( const RString& aPrefix, const RString& aUri, TInt aErrorCode );
       
    91 	void OnEndPrefixMappingL( const RString& aPrefix, TInt aErrorCode );
       
    92 	void OnIgnorableWhiteSpaceL( const TDesC8& aBytes, TInt aErrorCode );
       
    93 	void OnSkippedEntityL( const RString& aName, TInt aErrorCode );
       
    94 	void OnProcessingInstructionL( const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode );
       
    95 	void OnError( TInt aErrorCode );
       
    96 	TAny* GetExtendedInterface( const TInt32 aUid );
       
    97 
       
    98 private: // Data members
       
    99     RArray< TUid > iProcessUids;
       
   100     TInt iParserErrorCode;
       
   101     TInt iCharconvConverterState;
       
   102     TBool iSeenMasterSection;
       
   103     CParser* iParser;
       
   104     CCnvCharacterSetConverter* iConverter;
       
   105     HBufC* iXMLFileNameInstallTime;
       
   106     HBufC* iXMLFileNameUserSupplied;
       
   107     };
       
   108 
       
   109 
       
   110 #endif