LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
layoutsettings.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 #ifndef __LayoutSettings_h__
22 #define __LayoutSettings_h__
23 
24 #include "Common.h"
25 
26 #include <string>
27 #include <vector>
28 #include <set>
29 #include <glib.h>
30 #include <QtGlobal>
31 #include <QSizeF>
32 #include <QString>
33 #include <QPoint>
34 #include <QColor>
35 
37 {
38 public:
39 
41  bool autoPageSize; //default - true; if true, then the page will size fullwidth of launcher, and
42  // the height will be so it fits between the bottom of the page tab bar
43  // and the bottom of the launcher (geom.bottom)
44  // if false, then it will obey pageSizePctLauncherRelative
46  QSize pageVerticalBorderActivationAreaSizePx; //for top/bottom and sides; this is the "frame" around the page where something (e.g. and icon) hovered there for a period of time will cause an action
47  // (e.g. a page horiz. pan). Expressed as pixels from edge (10 = 10px from the corresponding edge of the page)
49 
50  quint32 pageTopBorderActivationTimeoutMs; // related to the activation size; it's the amount of time to wait on the hovered area without any motion before activating.
51  quint32 pageBottomBorderActivationTimeoutMs; // (in millisecs)
54 
63 
68 
70 
74 
75  //how far from the edge (left or right; that conf setting is TODO) should the button be.
76  // the measurement is pixels from QL bar top right/left corner to nearest top corner of the icon
77  // (e.g. QL top right, which is the default, to the icon's top right edge. This makes it icon size
78  // independent). It's in abs coordinates so x: -val is to the left of the corner, +val to the right
79  // y: -val is above.., +val is below
81 
82  //the offset from topLeft corner of QL. If the access button is on the left edge, then it will be
83  // from the point @ (button.right,QL.top)
84  //TODO: probably should allow this to be set auto (as an option), since it depends on the height of the QL and the sizes
85  // of the icons that will be in the QL.
87 
88  //you still have to be careful how you set this. It will not prevent things from overlapping. Consider the sizes of your icons
89  // and the potential sizes of the QL (in every screen configuration)
91 
93 
94  quint32 searchPillWidth;
98 
99  QPoint iconVisibleLocationOffsetPx; //how far away from the actual touch location should the icon be rendered.
100  // +values are down and to the right, -values are up and left)
101 
102  // this controls whether or not coordinates and sizes will be set to the nearest (sometimes next highest, sometimes next lowest)
103  // even integer; it's intended to work around rare, weird behavior in some cases,
104  // when rendering starting at an odd coordinate - this may not be needed in the future
105  // Note that this may cause things painted using this adjustment to not be aligned as expected (+-1 pixel off), and may
106  // run over the boundaries
108 
110  if (G_LIKELY(s_settings))
111  return s_settings;
112 
113  s_settings = new LayoutSettings();
114  return s_settings;
115  }
116 
117  static inline LayoutSettings* settings() {
118  return DiUiLayoutSettings();
119  }
120 
121 private:
122 
123  void load(const char* settingsFile);
124  void postLoad();
125 
126  LayoutSettings();
127  ~LayoutSettings();
128 
129  static LayoutSettings* s_settings;
130 };
131 
132 #endif // LayoutSettings
133