epoc32/include/conpics.h
branchSymbian3
changeset 4 837f303aceeb
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
       
     1 /*
       
     2 * Copyright (c) 1997-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 
       
    19 #ifndef __CONPICS_H__
       
    20 #define __CONPICS_H__
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 #include <s32stor.h>
       
    25 #include <gdi.h>
       
    26 #include <fldbltin.h>
       
    27 
       
    28 //
       
    29 // Classes declared in this file
       
    30 class CXzePicture;
       
    31 class CTestPicture;
       
    32 class CDummyField;
       
    33 
       
    34 /**
       
    35 @internalTechnology
       
    36 */
       
    37 const TUid KUidXzePictureType={268435508};
       
    38 
       
    39 /**
       
    40 @internalComponent
       
    41 */
       
    42 const TUid KUidXzeDoorType={268435509};
       
    43 
       
    44 /**
       
    45 @internalComponent
       
    46 */
       
    47 const TInt KWidthInTwips=360;
       
    48 const TInt KHeightInTwips=360;
       
    49 
       
    50 class MDemPictureFactory : public MPictureFactory
       
    51 /**
       
    52 @internalComponent
       
    53 */
       
    54 	{
       
    55 	// Instantiates new CDemPictureHeaders.
       
    56 public:
       
    57 	IMPORT_C MDemPictureFactory();  // Force GCC to export vtable.
       
    58 	IMPORT_C virtual void NewPictureL(TPictureHeader& aHeader,const CStreamStore& aDeferredPictureStore)const;
       
    59 	};
       
    60 
       
    61 
       
    62 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
       
    63 
       
    64 class CXzePicture : public CPicture
       
    65 /**
       
    66 @internalTechnology
       
    67 */
       
    68     {
       
    69 	// A simple test picture, that is store aware, and has state.
       
    70 	//
       
    71 public:
       
    72 	IMPORT_C static CXzePicture* NewL(TChar aLabel);
       
    73 	IMPORT_C static CXzePicture* NewL(const CStreamStore& aStore,TStreamId aId);
       
    74 	IMPORT_C virtual ~CXzePicture();
       
    75 	//
       
    76 	IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
       
    77 	IMPORT_C void InternalizeL(RReadStream& aStream);
       
    78 	IMPORT_C void RestoreL(const CStreamStore& aStore,TStreamId aId);
       
    79 	//
       
    80 	IMPORT_C void GetOriginalSizeInTwips(TSize& aSize) const;
       
    81 	//
       
    82 	IMPORT_C virtual void Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect,MGraphicsDeviceMap* aMap=NULL)const;
       
    83 protected:
       
    84 	IMPORT_C CXzePicture(TChar aLabel);
       
    85 	IMPORT_C CXzePicture();
       
    86 public:
       
    87 	TSize iOriginalSizeInTwips;
       
    88 	TChar iLabel;  // Provides object state.
       
    89 	};
       
    90 
       
    91 
       
    92 class CXzeDoor : public CXzePicture
       
    93 /**
       
    94 @internalComponent
       
    95 */
       
    96 	{
       
    97 	// A sample door, that has emulates 2 states of presence.  An iconic representation
       
    98 	// and a deep representation.
       
    99 	//
       
   100 public:
       
   101 	IMPORT_C static CXzeDoor* NewL(TChar aLabel,TBool aAlwaysFailToDetach=EFalse);
       
   102 	IMPORT_C static CXzeDoor* NewL(const CStreamStore& aStore,TStreamId aId);
       
   103 	//
       
   104 	IMPORT_C virtual void DetachFromStoreL(TDetach aDegree);
       
   105 	//
       
   106 	IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
       
   107 	IMPORT_C void InternalizeL(RReadStream& aStream);
       
   108 	IMPORT_C void RestoreL(const CStreamStore& aStore,TStreamId aId);
       
   109 protected:
       
   110 	IMPORT_C CXzeDoor(TChar aLabel,TBool aAlwaysFailToDetach);
       
   111 	IMPORT_C CXzeDoor(TBool aAlwaysFailToDetach);
       
   112 public:
       
   113 	TBool iAlwaysFailToDetach;
       
   114 	};
       
   115 
       
   116 
       
   117 class CTestPicture : public CPicture
       
   118 /**
       
   119 @internalTechnology
       
   120 */
       
   121     {
       
   122 public:
       
   123 	IMPORT_C static CTestPicture* NewL();
       
   124 	//
       
   125 	IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
       
   126 	//
       
   127 	IMPORT_C void GetOriginalSizeInTwips(TSize& aSize) const;
       
   128 	//
       
   129 	IMPORT_C virtual void Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect,MGraphicsDeviceMap* aMap=NULL) const;
       
   130 protected:
       
   131 	IMPORT_C CTestPicture();
       
   132 public:
       
   133 	TSize iOriginalSizeInTwips;
       
   134 	};
       
   135 
       
   136 ///////////////////////////////////////////////////////////////////////
       
   137 
       
   138 
       
   139 class CDummyField : public CTextField
       
   140 /**
       
   141 @internalTechnology
       
   142 */
       
   143 	{
       
   144 public:
       
   145 	IMPORT_C CDummyField();
       
   146 	IMPORT_C virtual TInt Value(TPtr& aValueText); // value is always "XXX"
       
   147 	IMPORT_C virtual void InternalizeL(RReadStream& aStream);
       
   148 	IMPORT_C virtual void ExternalizeL(RWriteStream& aStream)const;
       
   149 	IMPORT_C virtual TUid Type() const;
       
   150 	};
       
   151 
       
   152 #endif