LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
icondecorator.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2010-2012 Hewlett-Packard Development Company, L.P.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * LICENSE@@@ */
18 
19 
20 
21 
22 #ifndef ICONDECORATOR_H_
23 #define ICONDECORATOR_H_
24 
25 #include <QPointer>
26 #include <QRectF>
27 #include <QPointF>
28 #include <QPoint>
29 
30 class PixmapObject;
32 {
33 public:
34  IconDecorator();
35  IconDecorator(PixmapObject * p_pix,const QRectF& ownerCoordRelativeBounds);
37 
38  //returns the old one
39  PixmapObject * setNewPix(PixmapObject * p_newPix, bool show=false);
40  bool hitTest(const QPointF& pt) const;
41  bool hitTest(const QPoint& pt) const;
42  PixmapObject * pix() const;
43  void show();
44  void hide();
45 
46  QRectF m_bounds;
47 
48  //TODO: clean up the meaning and usage of m_iconGeom...there are inconsistencies w/ its usage as a geom
49  QRect m_iconGeom; //geom and pos are related to m_bounds...take care to not lose sync
50  QPoint m_iconPos;
51  QPointer<PixmapObject> m_qp_pixmap;
52  bool m_shown;
53 };
54 
55 #endif /* ICONDECORATOR_H_ */