epoc32/include/frmframe.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/frmframe.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/frmframe.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,118 @@
     1.4 -frmframe.h
     1.5 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +//
    1.19 +
    1.20 +#ifndef __FRMFRAME_H__
    1.21 +#define __FRMFRAME_H__
    1.22 +
    1.23 +#include <w32std.h>
    1.24 +
    1.25 +/** A rectangular frame surrounding a picture with eight smaller, square areas
    1.26 +(referred to as blobs) for moving and resizing the picture. A blob is located
    1.27 +on each corner and at the centre of each side.
    1.28 +
    1.29 +Each blob has a visible width and an active width. The active width allows
    1.30 +easier manipulation of picture frames because the blobs may be small and difficult
    1.31 +to manipulate with a pen. The active width should be set to be at least as
    1.32 +large as the visible width.
    1.33 +
    1.34 +A picture frame also has a set of flags which are used when drawing the frame.
    1.35 +These control the frame border visibility, whether blobs should be drawn inside
    1.36 +or outside the frame and whether the blobs should be filled using a solid
    1.37 +brush style or using a NULL brush style, causing them to appear dimmed. For
    1.38 +more information on brush styles. see CGraphicsContext::TBrushStyle.
    1.39 +@publishedAll
    1.40 +@released
    1.41 +*/
    1.42 +class TFrameOverlay
    1.43 +
    1.44 +    {
    1.45 +public:
    1.46 +/** This enumeration is used by CTextView::SetXyPosL() and by TFrameOverlay::XyPosToEdges()
    1.47 +to identify which active region of the picture frame a pixel position is in. */
    1.48 +enum TEdges
    1.49 +	{
    1.50 +	/** Not in an active region. */
    1.51 +	ENoEdges=0x00,
    1.52 +	/** In active region around left edge. */
    1.53 +	EEdgeLeft=0x01,
    1.54 +	/** In active region around right edge. */
    1.55 +	EEdgeRight=0x02,
    1.56 +	/** In active region around top edge. */
    1.57 +	EEdgeTop=0x04,
    1.58 +	/** In active region around bottom edge. */
    1.59 +	EEdgeBottom=0x08
    1.60 +	};
    1.61 +
    1.62 +/** Frame appearance flags. */
    1.63 +enum TFrameOverlayFlags
    1.64 +	{
    1.65 +	/** Controls whether blobs are drawn inside or outside the frame border. */
    1.66 +	EFrameOverlayFlagBlobsInternal=0x01,
    1.67 +	/** Controls whether the frame border is drawn or not. */
    1.68 +	EFrameOverlayFlagShowBorder=0x02,
    1.69 +	/** Controls whether the three blobs at the top of the frame are drawn dimmed. */
    1.70 +	EFrameOverlayFlagTopBlobsDimmed=0x04,
    1.71 +	/** Controls whether the three blobs at the bottom of the frame are drawn dimmed. */
    1.72 +	EFrameOverlayFlagBottomBlobsDimmed=0x08,
    1.73 +	/** Controls whether the three blobs on the left hand side of the frame are drawn
    1.74 +	dimmed. */
    1.75 +	EFrameOverlayFlagLeftBlobsDimmed=0x10,
    1.76 +	/** Controls whether the three blobs on the right hand side of the frame are drawn
    1.77 +	dimmed. */
    1.78 +	EFrameOverlayFlagRightBlobsDimmed=0x20
    1.79 +	};
    1.80 +public:
    1.81 +	IMPORT_C TFrameOverlay();
    1.82 +    IMPORT_C void SetBlobWidthInPixels(const TInt aWidth); //sets visible and active blob width
    1.83 +    IMPORT_C void SetVisibleBlobWidthInPixels(const TInt aWidth); //default zero
    1.84 +    IMPORT_C void SetActiveBlobWidthInPixels(const TInt aWidth); // default zero
    1.85 +	IMPORT_C void SetFlags(TInt aFlag);
    1.86 +    IMPORT_C void ClearFlags(TInt aFlag);
    1.87 +    IMPORT_C void SetRect(const TRect& aRect);
    1.88 +    IMPORT_C void XorDraw(CGraphicsContext& aGc) const;
    1.89 +    IMPORT_C TInt XyPosToEdges(const TPoint& aPos) const;
    1.90 +    inline TRect Rect() const;		// deprecated
    1.91 +    inline const TRect& RefRect() const;
    1.92 +    inline TInt Flags() const;
    1.93 +private:
    1.94 +	TInt VisibleBlobWidth() const;
    1.95 +	TInt ActiveMarginWidth() const;
    1.96 +	TBool DrawLeftAndRight() const;
    1.97 +	TBool DrawTopAndBottom() const;
    1.98 +	void DrawDottedRectangle(CGraphicsContext& aGc,const TRect& aRect) const;
    1.99 +private:
   1.100 +    TInt iFlags;
   1.101 +    TInt iVisibleBlobWidth;
   1.102 +	TInt iActiveBlobWidth;
   1.103 +	TRect iRect;
   1.104 +    };
   1.105 +
   1.106 +/** @deprecated */	
   1.107 +inline TRect TFrameOverlay::Rect() const
   1.108 +	{
   1.109 +	return(iRect);
   1.110 +	}
   1.111 +
   1.112 +inline const TRect& TFrameOverlay::RefRect() const
   1.113 +	{
   1.114 +	return(iRect);
   1.115 +	}
   1.116 +
   1.117 +TInt TFrameOverlay::Flags() const
   1.118 +	{
   1.119 +	return(iFlags);
   1.120 +	}
   1.121 +
   1.122 +#endif