memspyui/ui/avkon/inc/MemSpyViewBase.h
changeset 51 b048e15729d6
parent 44 5db69f4c3d06
child 52 36d60d12b4af
equal deleted inserted replaced
44:5db69f4c3d06 51:b048e15729d6
     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 MEMSPYVIEWBASE_H
       
    19 #define MEMSPYVIEWBASE_H
       
    20 
       
    21 // System includes
       
    22 #include <coecntrl.h>
       
    23 #include <aknlists.h>
       
    24 #include <memspyui.rsg>
       
    25 
       
    26 // User includes
       
    27 #include "MemSpy.hrh"
       
    28 #include "MemSpyViewType.h"
       
    29 #include "MemSpyViewObserver.h"
       
    30 #include "MemSpySettings.h"
       
    31 
       
    32 // Classes referenced
       
    33 class CMemSpyEngine;
       
    34 class CMemSpyContainer;
       
    35 class MMemSpyViewObserver;
       
    36 //cigasto
       
    37 class RMemSpySession;
       
    38 
       
    39 class CMemSpyViewBase : public CCoeControl, public MCoeControlObserver, public MEikListBoxObserver
       
    40     {
       
    41 public:
       
    42     //CMemSpyViewBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
       
    43 	CMemSpyViewBase( RMemSpySession& aSession, MMemSpyViewObserver& aObserver );
       
    44     ~CMemSpyViewBase();
       
    45     virtual void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );
       
    46 
       
    47 public: // API
       
    48     virtual TMemSpyViewType ViewType() const = 0;
       
    49     virtual CMemSpyViewBase* PrepareParentViewL();
       
    50     virtual CMemSpyViewBase* PrepareChildViewL();
       
    51     virtual void RefreshL();
       
    52     virtual TBool HandleCommandL( TInt aCommand );
       
    53 
       
    54 public: // Menu framework
       
    55     virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
    56     virtual TUint MenuCascadeResourceId() const;
       
    57     virtual TInt MenuCascadeCommandId() const;
       
    58 
       
    59 private: // Command handlers
       
    60     virtual void OnCmdViewOutputToSinkL();
       
    61 
       
    62 protected: // Construction support
       
    63     void SetTitleL( const TDesC& aText );
       
    64     TPtrC TitleL() const;
       
    65     virtual CEikListBox* ConstructListBoxL();
       
    66     virtual void SetListBoxModelL() = 0;
       
    67 
       
    68 protected: // Internal framework
       
    69     virtual void HandleListBoxItemActionedL( TInt aIndex );
       
    70     virtual void HandleListBoxItemSelectedL( TInt aIndex );
       
    71  
       
    72 protected: // Event reporting
       
    73     void ReportEventL( MMemSpyViewObserver::TViewEventType aEvent, TAny* aContext = NULL );
       
    74     void SetListBoxCurrentItemIndexL( TInt aIndex );
       
    75 
       
    76 protected: // Utility methods
       
    77     CMemSpyContainer& Container();
       
    78     CMemSpySettings& Settings();
       
    79     const CMemSpySettings& Settings() const;
       
    80 
       
    81 public: // From CCoeControl
       
    82 	TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    83 
       
    84 protected: // From CCoeControl
       
    85     void Draw( const TRect& aRect ) const;
       
    86     void SizeChanged();
       
    87     void FocusChanged( TDrawNow aDrawNow );
       
    88     TInt CountComponentControls() const;
       
    89     CCoeControl* ComponentControl( TInt aIndex ) const;
       
    90 
       
    91 protected: // From MCoeControlObserver
       
    92     void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );
       
    93 
       
    94 protected: // From MEikListBoxObserver
       
    95     void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType);
       
    96 
       
    97 protected: // Member data
       
    98     //CMemSpyEngine& iEngine;
       
    99     RMemSpySession& iMemSpySession;
       
   100     MMemSpyViewObserver& iObserver;
       
   101     //
       
   102     CEikListBox* iListBox;
       
   103 
       
   104 private:
       
   105     CMemSpySettings* iSettings;
       
   106     };
       
   107 
       
   108 
       
   109 #endif