/usr/include/x86_64-linux-gnu/alljoyn/controlpanel/Widget.h is in liballjoynservices-dev-1604 16.04-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | /******************************************************************************
* Copyright AllSeen Alliance. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************************/
#ifndef WIDGET_H_
#define WIDGET_H_
#include <alljoyn/BusAttachment.h>
#include <alljoyn/BusObject.h>
#include <alljoyn/InterfaceDescription.h>
#include <alljoyn/controlpanel/LanguageSet.h>
#include <alljoyn/controlpanel/ControlPanelEnums.h>
namespace ajn {
namespace services {
/*
* Forward Declaration
*/
class WidgetBusObject;
class ControlPanelDevice;
/**
* Base Class for all Widgets
*/
class Widget {
public:
/**
* Constructor for Widget class
* @param name - name of Widget
* @param rootWidget - the RootWidget of the widget
* @param widgetType - the type of the widget
*/
Widget(qcc::String const& name, Widget* rootWidget, WidgetType widgetType);
/**
* Constructor for Widget class
* @param name - name of Widget
* @param rootWidget - the RootWidget of the widget
* @param device - the device containing this widget
* @param widgetType - the type of the widget
*/
Widget(qcc::String const& name, Widget* rootWidget, ControlPanelDevice* device, WidgetType widgetType);
/**
* Destructor for Widget
*/
virtual ~Widget() = 0;
/**
* Pure virtual function. Needs to be implemented by a function that will
* create and return the appropriate BusObject for the Widget
* @param bus - the bus used to create the widget
* @param objectPath - the objectPath of the widget
* @param langIndx - the language Indx
* @param status - the status indicating success or failure
* @return a newly created WidgetBusObject
*/
virtual WidgetBusObject* createWidgetBusObject(BusAttachment* bus, qcc::String const& objectPath,
uint16_t langIndx, QStatus& status) = 0;
/**
* Get the widgetType of the Widget
* @return widgetType
*/
WidgetType getWidgetType() const;
/**
* Get the name of the Widget
* @return widgetName
*/
qcc::String const& getWidgetName() const;
/**
* Get the mode of the Widget
* @return controlPanelMode
*/
ControlPanelMode getControlPanelMode() const;
/**
* Get this widget's RootWidget
* @return rootWidget
*/
Widget* getRootWidget() const;
/**
* Get the Device of the widget
* @return device
*/
ControlPanelDevice* getDevice() const;
/**
* Get the Interface Version of the Widget
* @return interface Version
*/
const uint16_t getInterfaceVersion() const;
/**
* Set the isSecured boolean
* @param secured
*/
void setIsSecured(bool secured);
/**
* Get the isSecured boolean
* @return true/false
*/
bool getIsSecured() const;
/**
* Get IsEnabled boolean
* @return true/false
*/
bool getIsEnabled() const;
/**
* Get IsWritable boolean
* @return true/false
*/
bool getIsWritable() const;
/**
* Set the Enabled flag of the Widget
* @param enabled
*/
void setEnabled(bool enabled);
/**
* Get the GetEnabled function Pointer
* @return getEnabled function Pointer of the widget
*/
GetBoolFptr getGetEnabled() const;
/**
* Set the GetEnabled function Pointer
* @param getEnabled - function pointer to get the enabled boolean
*/
void setGetEnabled(GetBoolFptr getEnabled);
/**
* Set the Writable flag of the widget
* @param writable
*/
void setWritable(bool writable);
/**
* Get the GetWritable function Pointer
* @return getWritable function Pointer of the widget
*/
GetBoolFptr getGetWritable() const;
/**
* Set the GetWritable function Pointer
* @param getWritable - function pointer to get the writable boolean
*/
void setGetWritable(GetBoolFptr getWritable);
/**
* Get the States of the Widget
* @return states
*/
uint32_t getStates() const;
/**
* Set the States of the widget
* @param enabled - is widget enabled
* @param writable - is widget writable
*/
void setStates(uint8_t enabled, uint8_t writable);
/**
* Get the BgColor of the Widget
* @return bgColor
*/
uint32_t getBgColor() const;
/**
* Set the BgColor of the Widget
* @param bgColor
*/
void setBgColor(uint32_t bgColor);
/**
* Get the GetBgColor function pointer of the Widget
* @return GetBgColor function pointer
*/
GetUint32Fptr getGetBgColor() const;
/**
* Set the GetBgColor function pointer of the Widget
* @param getBgColor
*/
void setGetBgColor(GetUint32Fptr getBgColor);
/**
* Get the Label of the Widget
* @return label
*/
virtual const qcc::String& getLabel() const;
/**
* Get the Labels vector of the widget
* @return - label
*/
virtual const std::vector<qcc::String>& getLabels() const;
/**
* Set the labels vector of the widget
* @param labels - vector of labels
*/
virtual void setLabels(const std::vector<qcc::String>& labels);
/**
* Get the GetLabel function pointer
* @return GetLabel function pointer
*/
virtual GetStringFptr getGetLabels() const;
/**
* Set the GetLabel function pointer
* @param getLabels - getLabel function pointer
*/
virtual void setGetLabels(GetStringFptr getLabels);
/**
* Get the vector of Hints for the Widget
* @return hints Vector
*/
const std::vector<uint16_t>& getHints() const;
/**
* Set the vector of Hints for the Widget
* @param hints - hints vector
*/
void setHints(const std::vector<uint16_t>& hints);
/**
* Register the BusObjects for this Widget
* @param bus - the bus used to register the busObject
* @param objectPath - the objectPath of the busObject
* @return
*/
virtual QStatus registerObjects(BusAttachment* bus, qcc::String const& objectPath);
/**
* Register the BusObjects for this Widget
* @param bus - the bus used to register the busObjects
* @param languageSet - the languageSet to register the busObjects for
* @param objectPathPrefix - the objectPathPrefix of the busObject
* @param objectPathSuffix - the objectPathSuffix of the busObject
* @param isRoot - is this a rootWidget
* @return status - success/failure
*/
virtual QStatus registerObjects(BusAttachment* bus, LanguageSet const& languageSet,
qcc::String const& objectPathPrefix, qcc::String const& objectPathSuffix, bool isRoot = false);
/**
* Refresh the Widget
* @param bus - bus used for refreshing the object
* @return status - success/failure
*/
QStatus refreshObjects(BusAttachment* bus);
/**
* Unregister the BusObjects for this widget
* @param bus
* @return status - success/failure
*/
virtual QStatus unregisterObjects(BusAttachment* bus);
/**
* Fill MsgArg passed in with the States
* @param val - msgArg to fill
* @param languageIndx - language requested
* @return status - success/failure
*/
QStatus fillStatesArg(MsgArg& val, uint16_t languageIndx);
/**
* Fill MsgArg passed in with the OptParams
* @param val - msgArg to fill
* @param languageIndx - language requested
* @return status - success/failure
*/
virtual QStatus fillOptParamsArg(MsgArg& val, uint16_t languageIndx);
/**
* Read the MsgArg passed in and fill the Version property
* @param val - MsgArg passed in
* @return status - success/failure
*/
virtual QStatus readVersionArg(MsgArg* val);
/**
* Read the MsgArg passed in and fill the States property
* @param val - MsgArg passed in
* @return status - success/failure
*/
virtual QStatus readStatesArg(MsgArg* val);
/**
* Read the MsgArg passed in and fill the OptParams
* @param val - MsgArg passed in
* @return status - success/failure
*/
virtual QStatus readOptParamsArg(MsgArg* val);
/**
* Set a Property Changed Signal
* @return status - success/failure
*/
QStatus SendPropertyChangedSignal();
/**
* Callback when PropertyChanged signal is received
*/
void PropertyChanged();
protected:
/**
* The Name of the Widget
*/
qcc::String m_Name;
/**
* The WidgetType of the Widget
*/
WidgetType m_WidgetType;
/**
* The RootWidget of this Widget
*/
Widget* m_RootWidget;
/**
* Is the Widget Secured
*/
bool m_IsSecured;
/**
* Version of the Widget
*/
uint16_t m_Version;
/**
* States of the Widget
*/
uint32_t m_States;
/**
* GetEnabled function Pointer
*/
GetBoolFptr m_GetEnabled;
/**
* Get Writable Function Pointer
*/
GetBoolFptr m_GetWritable;
/**
* BgColor of the Widget
*/
uint32_t m_BgColor;
/**
* GetBgColor function Pointer of the Widget
*/
GetUint32Fptr m_GetBgColor;
/**
* Label
*/
qcc::String m_Label;
/**
* Vector of Labels
*/
std::vector<qcc::String> m_Labels;
/**
* GetLabel functionPointer
*/
GetStringFptr m_GetLabels;
/**
* Vector of Hints
*/
std::vector<uint16_t> m_Hints;
/**
* The BusObjects of the Widget
*/
std::vector<WidgetBusObject*> m_BusObjects;
/**
* Mode widget is in
*/
ControlPanelMode m_ControlPanelMode;
/**
* The Device that contains this widget
*/
ControlPanelDevice* m_Device;
/**
* Function to fill the OptParams of the Widget Base class
* @param optParams - msgArg Array to fill
* @param languageIndx - the language requested
* @param optParamIndx - the index of the optParams array to start from
* @return status - success/failure
*/
QStatus fillOptParamsArg(MsgArg* optParams, uint16_t languageIndx, size_t& optParamIndx);
/**
* Read the MsgArg passed in and fill the OptParam
* @param key - the optParam to fill
* @param val - the MsgArg passed in
* @return status - success/failure
*/
virtual QStatus readOptParamsArg(uint16_t key, MsgArg* val);
/**
* Check Versions of Remote Widget
* @return status - success/failure
*/
virtual QStatus checkVersions();
/**
* Add Children for Widget
* @param bus - bus to use
* @return status - success/failure
*/
virtual QStatus addChildren(BusAttachment* bus);
/**
* Refresh the Children of this Widget
* @param bus - bus to use
* @return status - success/failure
*/
virtual QStatus refreshChildren(BusAttachment* bus);
/**
* FillProperties for Widget
* @return status - success/failure
*/
virtual QStatus fillProperties();
private:
/**
* Copy constructor of widget - private. widget is not copy-able
* @param widget - widget to copy
*/
Widget(const Widget& widget);
/**
* Assignment operator of widget - private. widget is not assignable
* @param widget
* @return
*/
Widget& operator=(const Widget& widget);
};
} //namespace services
} //namespace ajn
#endif /* WIDGET_H_ */
|