summaryrefslogtreecommitdiff
path: root/common/browserdefs.h
blob: 64368e7343675134bfbaff2b6164baa0a48b3b51 (plain)
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
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
/**
 * Copyright (C) 2013, Pelagicore
 *
 * Author: Marcel Schuette <marcel.schuette@pelagicore.com>
 *
 * This file is part of the GENIVI project Browser Proof-Of-Concept
 * For further information, see http://genivi.org/
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#ifndef BROWSERDEFS_H
#define BROWSERDEFS_H

#include <QDBusArgument>

namespace conn {
    namespace brw {

    /*!
        * Browser errors definition.

        EID_NO_ERROR - No error
        EID_ALREADY_EXIST - Object already exists. It does not mean always an error. The browser could return EID_ALREADY_EXIST as info and provides required access data.
        EID_NOT_EXISTS - Object not exists. By the delete operation this error code is treated as a info status.
        EID_GENERAL_ERROR - Situation in which programmer did not know what to do
        EID_NOT_IMPLEMENTED - Method, functionality not implemented
        EID_NULL_POINTER - Null pointer
        EID_INVALID_STATE - The system or component is not ready execute the requested operation.
        EID_MAX_NUMBER_REACHED - Maximum number of records is reached.
        EID_INVALID_ARGUMENT - Invalid argument
        EID_DB_ITEM_NOT_EXISTS - Item does not exists in database
        EID_DB_ITEM_ALREADY_EXISTS - Item already exists in database
        EID_DB_CLOSED_HANDLE - Handle to database is closed
        EID_DB_QUERY_FAILS - Prepare of query fails
        EID_DB_EXEC_FAILS - Execute of query on database fails
        EID_DB_FILE_EXISTS - DB cannot create file on drive because file already exists
        EID_DB_DISK_OUT_OF_SPACE - DB cannot create file on drive because there is not enough space
        EID_DB_NO_PERMISSION - DB cannot write to file - lack of permission
        */
    //## type ERROR_IDS
    enum ERROR_IDS {
        EID_NO_ERROR,
        EID_ALREADY_EXIST,
        EID_GENERAL_ERROR,
        EID_NOT_IMPLEMENTED,
        EID_NULL_POINTER,
        EID_INVALID_STATE,
        EID_MAX_NUMBER_REACHED,
        EID_INVALID_ARGUMENT,
        EID_NOT_EXISTS,
        EID_DB_ITEM_NOT_EXISTS,
        EID_DB_ITEM_ALREADY_EXISTS,
        EID_DB_CLOSED_HANDLE,
        EID_DB_QUERY_FAILS,
        EID_DB_EXEC_FAILS,
        EID_DB_FILE_EXISTS,
        EID_DB_DISK_OUT_OF_SPACE,
        EID_DB_NO_PERMISSION,
        EID_FILESYSTEM_ERROR // TODO added
    };

    inline const QDBusArgument &operator>>(const QDBusArgument &argument, conn::brw::ERROR_IDS &errorid)
    {
        int i;
        argument.beginStructure();
        argument >> i;
        errorid = static_cast<conn::brw::ERROR_IDS>(i);
        argument.endStructure();
        return argument;
    }

    inline QDBusArgument &operator<<(QDBusArgument &argument, const conn::brw::ERROR_IDS &errorid)
    {
        argument.beginStructure();
        argument << static_cast<int>(errorid);
        argument.endStructure();
        return argument;
    }

    
    /*!
        * Defines sorting order of bookmarks:
        BST_UNSORTED - the bookmarks item are provided in the order how they have been added by the user.
        BST_TITLE_ASCENDING - the bookmarks are sorted by the title in ascending order;
        BST_TITLE_DESCENDING - the bookmarks are sorted by the title in descending order;
        BST_URL_ASCENDING - the bookmarks are sorted by the url in ascending order;
        BST_URL_DESCENDING - the bookmarks are sorted by the url in descending order;
        */
        //## type BOOKMARK_SORT_TYPE
        enum BOOKMARK_SORT_TYPE {
            BST_UNSORTED = 0,
            BST_TITLE_ASCENDING = 1,
            BST_TITLE_DESCENDING = 2,
            BST_URL_ASCENDING = 3,
            BST_URL_DESCENDING = 4
        };
    
        inline const QDBusArgument &operator>>(const QDBusArgument &argument, conn::brw::BOOKMARK_SORT_TYPE &bookmarksorttype)
        {
            int i;
            argument.beginStructure();
            argument >> i;
            bookmarksorttype = static_cast<conn::brw::BOOKMARK_SORT_TYPE>(i);
            argument.endStructure();
            return argument;
        }

        inline QDBusArgument &operator<<(QDBusArgument &argument, const conn::brw::BOOKMARK_SORT_TYPE &bookmarksorttype)
        {
            argument.beginStructure();
            argument << static_cast<int>(bookmarksorttype);
            argument.endStructure();
            return argument;
        }


        //## type BookmarkItem
        struct BookmarkItem {
            int i32Uid;                     //## attribute i32Uid
            int i32Type;                    //## attribute eType
            QString strParentFolderPath;    //## attribute strParentFolderPath
            QString strTitle;               //## attribute strTitle
            QString strUrl;                 //## attribute strUrl
            QString strIconPath;            //## attribute strIconPath
            QString strThumbnailPath;       //## attribute strThumbnailPath

            BookmarkItem()
                : i32Uid(0)
                , i32Type(0)
                , strParentFolderPath("")
                , strTitle("")
                , strUrl("")
                , strIconPath("")
                , strThumbnailPath("")
            {}
        };

        inline const QDBusArgument &operator>>(const QDBusArgument &argument, conn::brw::BookmarkItem &bookmarkitem)
        {
            argument.beginStructure();
            argument >> bookmarkitem.i32Uid >> bookmarkitem.i32Type >> bookmarkitem.strParentFolderPath >>
                        bookmarkitem.strTitle >> bookmarkitem.strUrl >> bookmarkitem.strIconPath >> bookmarkitem.strThumbnailPath;
            argument.endStructure();
            return argument;
        }

        inline QDBusArgument &operator<<(QDBusArgument &argument, const conn::brw::BookmarkItem &bookmarkitem)
        {
            argument.beginStructure();
            argument << bookmarkitem.i32Uid << bookmarkitem.i32Type << bookmarkitem.strParentFolderPath <<
                        bookmarkitem.strTitle << bookmarkitem.strUrl << bookmarkitem.strIconPath << bookmarkitem.strThumbnailPath;
            argument.endStructure();
            return argument;
        }


        
        //## class BookmarkItemList
        typedef QList<conn::brw::BookmarkItem> BookmarkItemList;    
        
        /*!
        * 
        */
        //## type SelectableOption
        struct SelectableOption {
            /*!
             * True - option can be selected; False - not - probably optgroup
             */
            bool bIsSelectableOption;
            /*!
            * 
            */
            QString strValue;		//## attribute strValue
            /*!
            * 
            */
            bool bSelected;		//## attribute bSelected

            SelectableOption() : bIsSelectableOption(true), strValue(), bSelected(false) {}
        };
        
        //## package connImports::Interfaces::conn::brw::def
        
        //## class SelectableOptionList
        /*!
        * 
        */
        typedef QList<conn::brw::SelectableOption> SelectableOptionList;

        //## operation operator>>(QDBusArgument,SelectableOption)
        inline const QDBusArgument& operator>>(const QDBusArgument& args, SelectableOption& selectableOption) {
            //#[ operation operator>>(QDBusArgument,SelectableOption)

            args.beginStructure();

            args >> selectableOption.bIsSelectableOption
                 >> selectableOption.strValue
                 >> selectableOption.bSelected;

            args.endStructure();
            return args;

            //#]
        }


        //## operation operator<<(QDBusArgument,SelectableOption)
        inline QDBusArgument& operator<<(QDBusArgument& args, const SelectableOption& selectableOption) {
            //#[ operation operator<<(QDBusArgument,SelectableOption)

            args.beginStructure();

            args << selectableOption.bIsSelectableOption
                 << selectableOption.strValue
                 << selectableOption.bSelected;

            args.endStructure();

            return args;

            //#]
        }
        

        /*!
                * Result of dialog.
                DR_OK - Prompt is accepted
                DR_CANCEL - Prompt is canceled
                */
        //## type DIALOG_RESULT
        enum DIALOG_RESULT {
            DR_CANCEL = 0,
            DR_OK = 1
        };

        inline const QDBusArgument &operator>>(const QDBusArgument &argument, conn::brw::DIALOG_RESULT &dialogresult)
        {
            int i;
            argument.beginStructure();
            argument >> i;
            dialogresult = static_cast<conn::brw::DIALOG_RESULT>(i);
            argument.endStructure();
            return argument;
        }

        inline QDBusArgument &operator<<(QDBusArgument &argument, const conn::brw::DIALOG_RESULT &dialogresult)
        {
            argument.beginStructure();
            argument << static_cast<int>(dialogresult);
            argument.endStructure();
            return argument;
        }

        /*!
                * Types of input element. See HTML5.

                IET_TEXT - The text input type defines a one-line input field that a user can enter text into.
                IET_COLOR - The color input type is used to specify a color.
                IET_DATE - The date input type is used to specify data, month and year
                IET_MONTH - The month input type is used to specify month and year
                IET_WEEK - The week input type is used to specify a week and year
                IET_TIME - The time input type is used to specify a time(hour and minute)
                IET_DATETIME - The datetime  input type is used to specify time, date, month and year (UTC time)
                IET_DATETIME_LOCAL - The datetime-local  input type is used to specify time, date, month and year (local time).
                IET_EMAIL - The email input type is used for input fields that should contain an e-mail address.
                IET_FILE - The file input type is used for file uploads.
                IET_NUMBER - The number input type is used for input fields that should contain a numeric value.
                IET_PASSWORD - The password input type defines a password field. The characters in a password field are masked (shown as asterisks or circles).
                IET_TEL - The tel input type is used for input fields that should contain a telephone number.
                IET_URL - The url input type is used for input fields that should contain a URL address.
                */
        //## type INPUT_ELEMENT_TYPE
        enum INPUT_ELEMENT_TYPE {
            IET_TEXT = 0,
            IET_COLOR = 1,
            IET_DATE = 2,
            IET_MONTH = 3,
            IET_WEEK = 4,
            IET_TIME = 5,
            IET_DATETIME = 6,
            IET_DATETIME_LOCAL = 7,
            IET_EMAIL = 8,
            IET_FILE = 9,
            IET_NUMBER = 10,
            IET_PASSWORD = 11,
            IET_TEL = 12,
            IET_URL = 13
        };

        inline const QDBusArgument &operator>>(const QDBusArgument &argument, conn::brw::INPUT_ELEMENT_TYPE &inputtype)
        {
            int i;
            argument.beginStructure();
            argument >> i;
            inputtype = static_cast<conn::brw::INPUT_ELEMENT_TYPE>(i);
            argument.endStructure();
            return argument;
        }

        inline QDBusArgument &operator<<(QDBusArgument &argument, const conn::brw::INPUT_ELEMENT_TYPE &inputtype)
        {
            argument.beginStructure();
            argument << static_cast<int>(inputtype);
            argument.endStructure();
            return argument;
        }



        /*!
                * Direction of scrolling or link selection.
                */
        //## type SCROLL_DIRECTION
        enum SCROLL_DIRECTION {
            SD_LEFT,
            SD_RIGHT,
            SD_TOP,
            SD_BOTTOM
        };

        inline const QDBusArgument &operator>>(const QDBusArgument &argument, conn::brw::SCROLL_DIRECTION &scrolldirection)
        {
            int i;
            argument.beginStructure();
            argument >> i;
            scrolldirection = static_cast<conn::brw::SCROLL_DIRECTION>(i);
            argument.endStructure();
            return argument;
        }

        inline QDBusArgument &operator<<(QDBusArgument &argument, const conn::brw::SCROLL_DIRECTION &scrolldirection)
        {
            argument.beginStructure();
            argument << static_cast<int>(scrolldirection);
            argument.endStructure();
            return argument;
        }

        /*!
                * Type of scrolling.
                ST_SYMBOL - Scrolling line by line.
                ST_PAGE - Scroll to the next or previous page.
                ST_LINK - Jump to the link.
                */
        //## type SCROLL_TYPE
        enum SCROLL_TYPE {
            ST_SYMBOL = 0,
            ST_PAGE = 1,
            ST_LINK = 2
        };

        inline const QDBusArgument &operator>>(const QDBusArgument &argument, conn::brw::SCROLL_TYPE &scrolltype)
        {
            int i;
            argument.beginStructure();
            argument >> i;
            scrolltype = static_cast<conn::brw::SCROLL_TYPE>(i);
            argument.endStructure();
            return argument;
        }

        inline QDBusArgument &operator<<(QDBusArgument &argument, const conn::brw::SCROLL_TYPE &scrolltype)
        {
            argument.beginStructure();
            argument << static_cast<int>(scrolltype);
            argument.endStructure();
            return argument;
        }

              
        //## type Rect
        struct Rect {
            int i32X;		//## attribute i32X
            int i32Y;		//## attribute i32Y
            int i32Width;	//## attribute i32Width
            int i32Height;	//## attribute i32Height

            Rect() : i32X(0), i32Y(0), i32Width(0), i32Height(0) {}
        };

        inline const QDBusArgument &operator>>(const QDBusArgument &argument, conn::brw::Rect &rect)
        {
            argument.beginStructure();
            argument >> rect.i32X >> rect.i32Y >> rect.i32Width >>
                        rect.i32Height;
            argument.endStructure();
            return argument;
        }

        inline QDBusArgument &operator<<(QDBusArgument &argument, const conn::brw::Rect &rect)
        {
            argument.beginStructure();
            argument << rect.i32X << rect.i32Y << rect.i32Width <<
                        rect.i32Height;
            argument.endStructure();
            return argument;
        }



        /*!
        * Defines type of the object handlers.
        */
        //## type OBJECT_HANDLE
        typedef qlonglong OBJECT_HANDLE;
        
        //## class ObjectHandleList
        typedef QList<conn::brw::OBJECT_HANDLE> ObjectHandleList;
        
        
        /*!
        * Browser scroll directions structure.
        */
        //## type BrowserScrollDirections
        struct BrowserScrollDirections {
            uchar u8Left;       //## attribute u8Left
            uchar u8Right;      //## attribute u8Right
            uchar u8Top;        //## attribute u8Top
            uchar u8Bottom;     //## attribute u8Bottom

            BrowserScrollDirections()
                : u8Left(0)
                , u8Right(0)
                , u8Top(0)
                , u8Bottom(0)
            {}
        };
        
        inline const QDBusArgument &operator>>(const QDBusArgument &argument, conn::brw::BrowserScrollDirections &browserscrolldirection)
        {
            argument.beginStructure();
            argument >> browserscrolldirection.u8Left >> browserscrolldirection.u8Right >> browserscrolldirection.u8Top >>
                        browserscrolldirection.u8Bottom;
            argument.endStructure();
            return argument;
        }

        inline QDBusArgument &operator<<(QDBusArgument &argument, const conn::brw::BrowserScrollDirections &browserscrolldirection)
        {
            argument.beginStructure();
            argument << browserscrolldirection.u8Left << browserscrolldirection.u8Right << browserscrolldirection.u8Top <<
                        browserscrolldirection.u8Bottom;
            argument.endStructure();
            return argument;
        }



        /*!
        * Structure describes availability of the actions in the browser. For example, if the BrowserActions::u8Back=0x03, the HMI could highlight the "back" button, if the state is 0x00 the "back" action is not available, HMI could show the "back" button in the disabled state.
        */
        //## type BrowserActions
        struct BrowserActions {
            /*!
            * Defines state of IPageView::back method/button.
            */
            uchar u8Back;       //## attribute u8Back
            /*!
            * Defines state of IPageView::forward method/button.
            */
            uchar u8Forward;        //## attribute u8Forward
            /*!
            * Defines state of IPageView::reload method/button.
            */
            uchar u8Reload;     //## attribute u8Reload
            /*!
            * Defines state of IPageView::stop method/button.
            */
            uchar u8Stop;       //## attribute u8Stop
            /*!
            * Defines state of IPageView::loadUrl method/button.
            */
            uchar u8LoadUrl;        //## attribute u8LoadUrl
            /*!
            * Defines state of IPageView::select method/button.
            */
            uchar u8Select;     //## attribute u8Select
            /*!
            * Defines state of IPageView::scroll(*, ST_SYMBOL) method/button.
            */
            BrowserScrollDirections sScrollSymbol;      //## attribute sScrollSymbol
            /*!
            * Defines state of IPageView::scroll(*, ST_PAGE) method/button.
            */
            BrowserScrollDirections sScrollPage;        //## attribute sScrollPage
            /*!
            * Defines state of IPageView::scroll(*, ST_LINK) method/button.
            */
            BrowserScrollDirections sScrollLink;        //## attribute sScrollLink

            BrowserActions()
            : u8Back(0)
            , u8Forward(0)
            , u8Reload(0)
            , u8Stop(0)
            , u8LoadUrl(0)
            , u8Select(0)
            , sScrollSymbol()
            , sScrollPage()
            , sScrollLink()
            {}
        };

        inline const QDBusArgument &operator>>(const QDBusArgument &argument, conn::brw::BrowserActions &browseractions)
        {
            argument.beginStructure();
            argument >> browseractions.u8Back >> browseractions.u8Forward >> browseractions.u8Reload >>
                        browseractions.u8Stop >> browseractions.u8LoadUrl >> browseractions.u8Select >>
                        browseractions.sScrollSymbol >> browseractions.sScrollPage >> browseractions.sScrollLink;
            argument.endStructure();
            return argument;
        }

        inline QDBusArgument &operator<<(QDBusArgument &argument, const conn::brw::BrowserActions &browseractions)
        {
            argument.beginStructure();
            argument << browseractions.u8Back << browseractions.u8Forward << browseractions.u8Reload <<
                        browseractions.u8Stop << browseractions.u8LoadUrl << browseractions.u8Select <<
                        browseractions.sScrollSymbol << browseractions.sScrollPage << browseractions.sScrollLink;
            argument.endStructure();
            return argument;
        }
        
        /*!
        * Defines policy of cache usage.
        CP_CACHE_ONLINE - Use cache if present, network if not.
        CP_CACHE_ONLY - Only cache is used.
        CP_ONLINE_ONLY - Cache is disabled.
        
        */
        //## type CACHE_POLICY
        enum CACHE_POLICY {
            CP_ONLINE_CACHE = 0x00,
            CP_CACHE_ONLY = 0x01,
            CP_ONLINE_ONLY = 0x02
        };

        //## operation operator>>(QDBusArgument,CACHE_POLICY)
        inline const QDBusArgument& operator>>(const QDBusArgument& args, CACHE_POLICY& cachePolicy) {
            //#[ operation operator>>(QDBusArgument,CACHE_POLICY)
            args.beginStructure();
            int temp =0;
            args>>temp;
            switch (temp )
            {
            case CP_ONLINE_CACHE:
            {
                cachePolicy = CP_ONLINE_CACHE;
            }
                break;
            case CP_CACHE_ONLY :
            {
                cachePolicy = CP_CACHE_ONLY;
            }
                break;
            case CP_ONLINE_ONLY:
            {
                cachePolicy = CP_ONLINE_ONLY;
            }
                break;
            }

            args.endStructure();
            return args;
            //#]
        }

        //## operation operator<<(QDBusArgument,CACHE_POLICY)
        inline const QDBusArgument& operator<<(QDBusArgument& args, CACHE_POLICY cachePolicy) {
            //#[ operation operator<<(QDBusArgument,CACHE_POLICY)
            args.beginStructure();
            int param = cachePolicy;
            args << param;
            args.endStructure();
            return args;
            //#]
        }

        /*!
        * Defines sorting order of error items:
        EST_DATE_ASCENDING - the error items are sorted by the date in ascending order;
        EST_DATE_DESCENDING - the error items are sorted by the date in descending order;

        */
        //## type ERROR_SORT_TYPE
        enum ERROR_SORT_TYPE
        {
            EST_DATE_ASCENDING = 0,
            EST_DATE_DESCENDING = 1
        };

        //## operation operator>>(QDBusArgument,ERROR_SORT_TYPE)
        inline const QDBusArgument& operator>>(const QDBusArgument& a_rDbusArg, ERROR_SORT_TYPE& a_rArg) {
            //#[ operation operator>>(QDBusArgument,ERROR_SORT_TYPE)
            a_rDbusArg.beginStructure();

            int param = 0;
            a_rDbusArg >> param;

            switch (param)
            {
            case EST_DATE_ASCENDING:
            {
                a_rArg = EST_DATE_ASCENDING;
                break;
            }
            case EST_DATE_DESCENDING:
            {
                a_rArg = EST_DATE_DESCENDING;
                break;
            }
            }
            a_rDbusArg.endStructure();
            return a_rDbusArg;
            //#]
        }

        //## operation operator<<(QDBusArgument,ERROR_SORT_TYPE)
        inline const QDBusArgument& operator<<(QDBusArgument& a_rDbusArg, ERROR_SORT_TYPE a_rArg) {
            //#[ operation operator<<(QDBusArgument,ERROR_SORT_TYPE)
            a_rDbusArg.beginStructure();
            int param = a_rArg;
            a_rDbusArg << param;
            a_rDbusArg.endStructure();
            return a_rDbusArg;
            //#]
        }
        struct ErrorItem
        {
            /*!
            * Timestamp when the error happened
            */
            qlonglong i64DateTime;		//## attribute i64DateTime
            /*!
            * Browser version
            */
            QString strBrowserVersion;		//## attribute strBrowserVersion
            /*!
            * Internet connection used.
            */
            QString strConnectionType;		//## attribute strConnectionType
            /*!
            * Error code. It could be HTTP error codes, or internal codes.
            */
            QString strCode;		//## attribute strCode
            /*!
            * Information about the place where the error happened. Could be name of a module, class or method.
            */
            QString strSource;		//## attribute strSource
            /*!
            * Short text description of the error.
            */
            QString strDescription;		//## attribute strDescription
        };

        inline bool ltError(ErrorItem a, ErrorItem b)
        {
            return a.i64DateTime < b.i64DateTime;
        }

        inline bool gtError( ErrorItem a, ErrorItem b)
        {
            return a.i64DateTime > b.i64DateTime;
        }

        //## package connInterfaces::connPublic::conn::brw::def
        //## class ErrorItemList
        /*!
        *
        */
        typedef QList<conn::brw::ErrorItem> ErrorItemList;

        //## operation operator>>(QDBusArgument,ErrorItem)
        inline const QDBusArgument& operator>>(const QDBusArgument& args, ErrorItem& error) {
            //#[ operation operator>>(QDBusArgument,ErrorItem)
            args.beginStructure();
            args >> error.i64DateTime
                 >> error.strBrowserVersion
                 >> error.strConnectionType
                 >> error.strCode
                 >> error.strSource
                 >> error.strDescription;
            args.endStructure();
            return args;
            //#]
        }

        //## operation operator<<(QDBusArgument,ErrorItem)
        inline QDBusArgument& operator<<(QDBusArgument& args, const ErrorItem& error) {
            //#[ operation operator<<(QDBusArgument,ErrorItem)
            args.beginStructure();
            args << error.i64DateTime
                 << error.strBrowserVersion
                 << error.strConnectionType
                 << error.strCode
                 << error.strSource
                 << error.strDescription;
            args.endStructure();
            return args;
            //#]
        }

        /*!
        * Authentication data used for Server and Proxy authentication.
        */
        //## type AuthenticationData
        struct AuthenticationData
        {
            /*!
            * Host name or Url for which the password is valid. In case of proxy authentication the customer receives "host:port" url, in case of the content authentication the url contans the resource URI.
            */
            QString strHost;		//## attribute strHost
            /*!
            * User name
            */
            QString strUserName;		//## attribute strUserName
            /*!
            * User password
            */
            QString strPassword;		//## attribute strPassword
            /*!
            * Defines to store password into database.
            */
            bool bSave;		//## attribute bSave

            AuthenticationData()
                :strHost("")
                ,strUserName("")
                ,strPassword("")
                ,bSave(true)
            {}
        };
        inline const QDBusArgument& operator>>(const QDBusArgument& args, AuthenticationData& ad) {
            args.beginStructure();
            args >> ad.strHost
                 >> ad.strUserName
                 >> ad.strPassword
                 >> ad.bSave;
            args.endStructure();
            return args;
        }

        inline QDBusArgument& operator<<(QDBusArgument& args, const AuthenticationData& ad) {
            args.beginStructure();
            args << ad.strHost
                 << ad.strUserName
                 << ad.strPassword
                 << ad.bSave;
            args.endStructure();
            return args;
        }
        
        /*!
         * SslErrors
         */
        //## type SSL_ERROR
        enum SSL_ERROR {
            NoError,
            UnableToGetIssuerCertificate,
            UnableToDecryptCertificateSignature,
            UnableToDecodeIssuerPublicKey,
            CertificateSignatureFailed,
            CertificateNotYetValid,
            CertificateExpired,
            InvalidNotBeforeField,
            InvalidNotAfterField,
            SelfSignedCertificate,
            SelfSignedCertificateInChain,
            UnableToGetLocalIssuerCertificate,
            UnableToVerifyFirstCertificate,
            CertificateRevoked,
            InvalidCaCertificate,
            PathLengthExceeded,
            InvalidPurpose,
            CertificateUntrusted,
            CertificateRejected,
            SubjectIssuerMismatch,
            hostnamemismatch,
            AuthorityIssuerSerialNumberMismatch,
            NoPeerCertificate,
            HostNameMismatch,
            NoSslSupport,
            CertificateBlacklisted,
            UnspecifiedError = -1
        };

        inline const QDBusArgument& operator>>(const QDBusArgument& args, SSL_ERROR& e) {
            args.beginStructure();
            int temp =0;
            args>>temp;
            e = (SSL_ERROR)temp;
            args.endStructure();
            return args;
        }

        inline QDBusArgument& operator<<(QDBusArgument& args, const SSL_ERROR &e) {
            args.beginStructure();
            int param = e;
            args << param;
            args.endStructure();
            return args;
        }

        /*!
        * The SslError structure describes the error information happens during ssl connection.
        */
        //## type SslError
        struct SslError {
            /*!
            * Error code. It could be HTTP error codes, or internal codes.
            */
            SSL_ERROR sslError;		//## attribute sslError
            /*!
            * Url
            */
            QString strUrl;		//## attribute strUrl
            /*!
            * Short text description of the error.
            */
            QString strErrorMessage;		//## attribute strErrorMessage
        };
        inline const QDBusArgument& operator>>(const QDBusArgument& args, SslError& s) {
            args.beginStructure();
            args >> s.sslError
                 >> s.strUrl
                 >> s.strErrorMessage;
            args.endStructure();
            return args;
        }

        inline QDBusArgument& operator<<(QDBusArgument& args, const SslError& s) {
            args.beginStructure();
            args << s.sslError
                 << s.strUrl
                 << s.strErrorMessage;
            args.endStructure();
            return args;
        }
    }
}

Q_DECLARE_METATYPE(conn::brw::ERROR_IDS)
Q_DECLARE_METATYPE(conn::brw::BOOKMARK_SORT_TYPE)
Q_DECLARE_METATYPE(conn::brw::BookmarkItem)
Q_DECLARE_METATYPE(conn::brw::BookmarkItemList)
Q_DECLARE_METATYPE(conn::brw::DIALOG_RESULT)
Q_DECLARE_METATYPE(conn::brw::INPUT_ELEMENT_TYPE)
Q_DECLARE_METATYPE(conn::brw::SCROLL_DIRECTION)
Q_DECLARE_METATYPE(conn::brw::SCROLL_TYPE)
Q_DECLARE_METATYPE(conn::brw::Rect)
Q_DECLARE_METATYPE(conn::brw::BrowserScrollDirections)
Q_DECLARE_METATYPE(conn::brw::BrowserActions)
Q_DECLARE_METATYPE(conn::brw::OBJECT_HANDLE)
Q_DECLARE_METATYPE(conn::brw::ObjectHandleList)
Q_DECLARE_METATYPE(conn::brw::SelectableOption);
Q_DECLARE_METATYPE(conn::brw::SelectableOptionList);
Q_DECLARE_METATYPE(conn::brw::CACHE_POLICY);
Q_DECLARE_METATYPE(conn::brw::ErrorItemList);
Q_DECLARE_METATYPE(conn::brw::ErrorItem);
Q_DECLARE_METATYPE(conn::brw::ERROR_SORT_TYPE);
Q_DECLARE_METATYPE(conn::brw::AuthenticationData);
Q_DECLARE_METATYPE(conn::brw::SslError);
Q_DECLARE_METATYPE(conn::brw::SSL_ERROR);

#endif // BROWSERDEFS_H