lafagnosticuifoundation/graphicseffects/ClientInc/RegisteredControl.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef _REGISTEREDCONTROL_H_
       
    17 #define _REGISTEREDCONTROL_H_
       
    18 
       
    19 #include <vwsdef.h> // TVwsViewId
       
    20 #include <e32base.h>
       
    21 #include "TransitionControl.h"
       
    22 
       
    23 class CCoeControl;
       
    24 
       
    25 /**
       
    26 Implementation of the registered control class
       
    27 
       
    28 @internalTechnology
       
    29 */
       
    30 NONSHARABLE_CLASS(CRegisteredControl) : public CBase
       
    31 	{
       
    32 public:
       
    33 	enum TType 
       
    34 		{
       
    35 		ECoeControl,
       
    36 		EView,
       
    37 		EDrawItemControl
       
    38 		};
       
    39 	CRegisteredControl( const CCoeControl* aCoeControl, TUid const & aUid, TBool aNLayered);
       
    40 	CRegisteredControl( const CCoeControl* aCoeControl, TVwsViewId const & aViewId, TUid aUid );
       
    41 	CRegisteredControl( const CCoeControl* aCoeControl, TUid aUid );
       
    42 	
       
    43 	~CRegisteredControl();
       
    44 	//transitions
       
    45 	void ResetTransitions();
       
    46 	TInt AddTransition(CTransitionControl* aTransControl);
       
    47 	void RemoveTransition(CTransitionControl* aTransControl);
       
    48 	inline TInt InTransitionCount();
       
    49 	//inline setters/getters
       
    50 	inline TUid Uid() const;
       
    51 	inline TVwsViewId const &ViewId() const;
       
    52 	inline TType Type() const;
       
    53 	inline const CCoeControl* Control() const;
       
    54 	inline TBool IsNLayered() const;
       
    55 	inline TUint Flags() const;
       
    56 	inline TBool Registered() const;
       
    57 	
       
    58 	inline void SetRegistered(TBool aRegistered);
       
    59 	inline void SetUid(TUid const & aUid);
       
    60 	inline void SetViewId(TVwsViewId const & aViewId);
       
    61 	inline void SetType(TType aType);
       
    62 	inline void SetControl(const CCoeControl* aControl);
       
    63 	inline void SetNLayered(TBool aIsNLayered);
       
    64 	inline void SetFlags(TUint aFlags);
       
    65 	
       
    66 private:
       
    67 	RPointerArray<CTransitionControl> iTransitions; //does not own the ctranscontrols
       
    68 	TType iType;
       
    69 	TUid iUid;
       
    70 	const CCoeControl* iKey;
       
    71 	TVwsViewId iViewId;		
       
    72 	TBool iNLayered;
       
    73 	TBool iRegistered;
       
    74 	TUint iFlags;
       
    75 	};
       
    76 
       
    77 //Inline definitions.
       
    78 
       
    79 //Getters
       
    80 TInt CRegisteredControl::InTransitionCount()
       
    81 	{
       
    82 	return iTransitions.Count();
       
    83 	}
       
    84 
       
    85 TUid CRegisteredControl::Uid() const
       
    86 	{
       
    87 	return iUid;
       
    88 	}
       
    89 TVwsViewId const & CRegisteredControl::ViewId() const
       
    90 	{
       
    91 	return iViewId;
       
    92 	}
       
    93 CRegisteredControl::TType CRegisteredControl::Type() const
       
    94 	{
       
    95 	return iType;
       
    96 	}
       
    97 const CCoeControl* CRegisteredControl::Control() const
       
    98 	{
       
    99 	return iKey;
       
   100 	}
       
   101 TBool CRegisteredControl::IsNLayered() const
       
   102 	{
       
   103 	return iNLayered;
       
   104 	}
       
   105 	
       
   106 TUint CRegisteredControl::Flags() const
       
   107 	{
       
   108 	return iFlags;
       
   109 	}	
       
   110 
       
   111 TBool CRegisteredControl::Registered() const
       
   112 	{
       
   113 	return iRegistered;
       
   114 	}
       
   115 		
       
   116 //Setters
       
   117 
       
   118 void CRegisteredControl::SetRegistered(TBool aRegistered)
       
   119 	{
       
   120 	iRegistered = aRegistered;
       
   121 	}
       
   122 
       
   123 void CRegisteredControl::SetUid(TUid const & aUid)
       
   124 	{
       
   125 	iUid = aUid;
       
   126 	}
       
   127 void CRegisteredControl::SetViewId(TVwsViewId const & aViewId)
       
   128 	{
       
   129 	iViewId = aViewId;
       
   130 	}
       
   131 void CRegisteredControl::SetType(TType aType)
       
   132 	{
       
   133 	iType = aType;
       
   134 	}
       
   135 void CRegisteredControl::SetControl(const CCoeControl* aControl)
       
   136 	{
       
   137 	iKey = aControl;
       
   138 	}
       
   139 void CRegisteredControl::SetNLayered(TBool aIsNLayered)
       
   140 	{
       
   141 	iNLayered = aIsNLayered;
       
   142 	}
       
   143 
       
   144 void CRegisteredControl::SetFlags(TUint aFlags)
       
   145 	{
       
   146 	iFlags = aFlags;
       
   147 	}
       
   148 
       
   149 #endif