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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __FRMFRAME_H__
17 #define __FRMFRAME_H__
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.
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.
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.
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. */
46 /** Not in an active region. */
48 /** In active region around left edge. */
50 /** In active region around right edge. */
52 /** In active region around top edge. */
54 /** In active region around bottom edge. */
58 /** Frame appearance flags. */
59 enum TFrameOverlayFlags
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
71 EFrameOverlayFlagLeftBlobsDimmed=0x10,
72 /** Controls whether the three blobs on the right hand side of the frame are drawn
74 EFrameOverlayFlagRightBlobsDimmed=0x20
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;
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;
97 TInt iVisibleBlobWidth;
98 TInt iActiveBlobWidth;
103 inline TRect TFrameOverlay::Rect() const
108 inline const TRect& TFrameOverlay::RefRect() const
113 TInt TFrameOverlay::Flags() const