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