epoc32/include/frmframe.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 frmframe.h
     1 // Copyright (c) 1997-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __FRMFRAME_H__
       
    17 #define __FRMFRAME_H__
       
    18 
       
    19 #include <w32std.h>
       
    20 
       
    21 /** A rectangular frame surrounding a picture with eight smaller, square areas
       
    22 (referred to as blobs) for moving and resizing the picture. A blob is located
       
    23 on each corner and at the centre of each side.
       
    24 
       
    25 Each blob has a visible width and an active width. The active width allows
       
    26 easier manipulation of picture frames because the blobs may be small and difficult
       
    27 to manipulate with a pen. The active width should be set to be at least as
       
    28 large as the visible width.
       
    29 
       
    30 A picture frame also has a set of flags which are used when drawing the frame.
       
    31 These control the frame border visibility, whether blobs should be drawn inside
       
    32 or outside the frame and whether the blobs should be filled using a solid
       
    33 brush style or using a NULL brush style, causing them to appear dimmed. For
       
    34 more information on brush styles. see CGraphicsContext::TBrushStyle.
       
    35 @publishedAll
       
    36 @released
       
    37 */
       
    38 class TFrameOverlay
       
    39 
       
    40     {
       
    41 public:
       
    42 /** This enumeration is used by CTextView::SetXyPosL() and by TFrameOverlay::XyPosToEdges()
       
    43 to identify which active region of the picture frame a pixel position is in. */
       
    44 enum TEdges
       
    45 	{
       
    46 	/** Not in an active region. */
       
    47 	ENoEdges=0x00,
       
    48 	/** In active region around left edge. */
       
    49 	EEdgeLeft=0x01,
       
    50 	/** In active region around right edge. */
       
    51 	EEdgeRight=0x02,
       
    52 	/** In active region around top edge. */
       
    53 	EEdgeTop=0x04,
       
    54 	/** In active region around bottom edge. */
       
    55 	EEdgeBottom=0x08
       
    56 	};
       
    57 
       
    58 /** Frame appearance flags. */
       
    59 enum TFrameOverlayFlags
       
    60 	{
       
    61 	/** Controls whether blobs are drawn inside or outside the frame border. */
       
    62 	EFrameOverlayFlagBlobsInternal=0x01,
       
    63 	/** Controls whether the frame border is drawn or not. */
       
    64 	EFrameOverlayFlagShowBorder=0x02,
       
    65 	/** Controls whether the three blobs at the top of the frame are drawn dimmed. */
       
    66 	EFrameOverlayFlagTopBlobsDimmed=0x04,
       
    67 	/** Controls whether the three blobs at the bottom of the frame are drawn dimmed. */
       
    68 	EFrameOverlayFlagBottomBlobsDimmed=0x08,
       
    69 	/** Controls whether the three blobs on the left hand side of the frame are drawn
       
    70 	dimmed. */
       
    71 	EFrameOverlayFlagLeftBlobsDimmed=0x10,
       
    72 	/** Controls whether the three blobs on the right hand side of the frame are drawn
       
    73 	dimmed. */
       
    74 	EFrameOverlayFlagRightBlobsDimmed=0x20
       
    75 	};
       
    76 public:
       
    77 	IMPORT_C TFrameOverlay();
       
    78     IMPORT_C void SetBlobWidthInPixels(const TInt aWidth); //sets visible and active blob width
       
    79     IMPORT_C void SetVisibleBlobWidthInPixels(const TInt aWidth); //default zero
       
    80     IMPORT_C void SetActiveBlobWidthInPixels(const TInt aWidth); // default zero
       
    81 	IMPORT_C void SetFlags(TInt aFlag);
       
    82     IMPORT_C void ClearFlags(TInt aFlag);
       
    83     IMPORT_C void SetRect(const TRect& aRect);
       
    84     IMPORT_C void XorDraw(CGraphicsContext& aGc) const;
       
    85     IMPORT_C TInt XyPosToEdges(const TPoint& aPos) const;
       
    86     inline TRect Rect() const;		// deprecated
       
    87     inline const TRect& RefRect() const;
       
    88     inline TInt Flags() const;
       
    89 private:
       
    90 	TInt VisibleBlobWidth() const;
       
    91 	TInt ActiveMarginWidth() const;
       
    92 	TBool DrawLeftAndRight() const;
       
    93 	TBool DrawTopAndBottom() const;
       
    94 	void DrawDottedRectangle(CGraphicsContext& aGc,const TRect& aRect) const;
       
    95 private:
       
    96     TInt iFlags;
       
    97     TInt iVisibleBlobWidth;
       
    98 	TInt iActiveBlobWidth;
       
    99 	TRect iRect;
       
   100     };
       
   101 
       
   102 /** @deprecated */	
       
   103 inline TRect TFrameOverlay::Rect() const
       
   104 	{
       
   105 	return(iRect);
       
   106 	}
       
   107 
       
   108 inline const TRect& TFrameOverlay::RefRect() const
       
   109 	{
       
   110 	return(iRect);
       
   111 	}
       
   112 
       
   113 TInt TFrameOverlay::Flags() const
       
   114 	{
       
   115 	return(iFlags);
       
   116 	}
       
   117 
       
   118 #endif