javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/eswtwidgetsexpanded.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*******************************************************************************
       
     2  * Copyright (c) 2005, 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved. This program and the accompanying materials
       
     4  * are made available under the terms of the Eclipse Public License v1.0
       
     5  * which accompanies this distribution, and is available at
       
     6  * http://www.eclipse.org/legal/epl-v10.html
       
     7  *
       
     8  * Contributors:
       
     9  *     Nokia Corporation - S60 implementation
       
    10  *******************************************************************************/
       
    11 
       
    12 
       
    13 #ifndef ESWTWIDGETSEXPANDED_H
       
    14 #define ESWTWIDGETSEXPANDED_H
       
    15 
       
    16 
       
    17 #include <eiklbi.h>
       
    18 #include "eswt.h"
       
    19 #include "eswtwidgetscore.h"
       
    20 
       
    21 
       
    22 class MSwtListBase;
       
    23 class MSwtColor;
       
    24 class CSwtFontData;
       
    25 class MSwtTable;
       
    26 class CGraphicsContext;
       
    27 
       
    28 
       
    29 class MSwtClipboard
       
    30 {
       
    31 protected:
       
    32     virtual ~MSwtClipboard() {}
       
    33 
       
    34 public:
       
    35     /**
       
    36      * Disposes of (i.e. destroys) the control
       
    37      * @return The Java peer associated with this object
       
    38      */
       
    39     virtual TSwtPeer Dispose() =0;
       
    40 
       
    41     /**
       
    42      * Clears the Clipboard.
       
    43      */
       
    44     virtual void ClearL() =0;
       
    45 
       
    46     /**
       
    47      * Gets the types of the data available in the Clipboard.
       
    48      * @param aTypes Upon call, this array must contain the data types to
       
    49      *        enquire about. Upon return, the non-available types will
       
    50      *        have been removed from it.
       
    51      */
       
    52     virtual void GetAvailableTypesL(RArray<TInt>& aTypes) const =0;
       
    53 
       
    54     /**
       
    55      * Returns the contents of the clipboard, as an array of bytes.
       
    56      * @param aTypeId Identifier of the expected type of the data
       
    57      *        contained in the clipboard.
       
    58      * @return the data, or NULL if no data of type aTypeId is found
       
    59      *        the clipboard.
       
    60      */
       
    61     virtual HBufC8* GetByteContentsL(TInt aDataId) const =0;
       
    62 
       
    63     /**
       
    64      * Returns the contents of the clipboard, as a text descriptor.
       
    65      * @return the text descriptor, or NULL if no text is found in the clipboard.
       
    66      */
       
    67     virtual HBufC* GetTextContentsL() const =0;
       
    68 
       
    69     /**
       
    70      * Set the content of the clipboard with a byte descriptor.
       
    71      * @param aPtr      The byte descriptor.
       
    72      * @param aJavaType The Java type identifier of the data.
       
    73      */
       
    74     virtual void SetByteContentL(const TDesC8& aPtr, TInt aJavaType) =0;
       
    75 
       
    76     /**
       
    77      * Set the content of the clipboard with a text descriptor.
       
    78      * @param aPtr The text descriptor.
       
    79      */
       
    80     virtual void SetTextContentL(const TDesC& aPtr) =0;
       
    81 };
       
    82 
       
    83 
       
    84 class MSwtTableColumn
       
    85 {
       
    86 protected:
       
    87     virtual ~MSwtTableColumn() {}
       
    88 
       
    89 public:
       
    90     virtual TSwtPeer JavaPeer() const =0;
       
    91 
       
    92     /**
       
    93      * Disposes of (i.e. destroys) the TableColumn.
       
    94      */
       
    95     virtual TSwtPeer Dispose() =0;
       
    96 
       
    97     /**
       
    98      * Returns the alignment
       
    99      */
       
   100     virtual TInt Alignment() const =0;
       
   101 
       
   102     /**
       
   103      * Sets the column to its preferred size.
       
   104      */
       
   105     virtual void Pack() =0;
       
   106 
       
   107     /**
       
   108      * Sets the alignment of the column.
       
   109      */
       
   110     virtual void SetAlignment(TInt aAlignment) =0;
       
   111 
       
   112     /**
       
   113      * Sets the text of the column.
       
   114      */
       
   115     virtual void SetTextL(const TDesC& aText) =0;
       
   116 
       
   117     /**
       
   118      * Returns the text of the TableColumn
       
   119      *
       
   120      * @result A pointer ot the text. Cannot be null.
       
   121      */
       
   122     virtual const TDesC* GetText() const =0;
       
   123 
       
   124     /**
       
   125      * Sets the width of the column.
       
   126      */
       
   127     virtual void SetWidth(TInt aWidth) =0;
       
   128 
       
   129     /**
       
   130      * Returns the width of the column.
       
   131      */
       
   132     virtual TInt Width() const =0;
       
   133 
       
   134     /**
       
   135      * set the image of the TableColumn
       
   136      */
       
   137     virtual void SetColumnImage(const MSwtImage* aImage) =0;
       
   138 
       
   139     /**
       
   140      * Returns whether the column can be resized by the user
       
   141      */
       
   142     virtual TBool GetResizable() const = 0;
       
   143 
       
   144     /**
       
   145      * Sets the column's ability to be resized by the user
       
   146      */
       
   147     virtual void SetResizable(TBool aResizable) =0;
       
   148 
       
   149     /**
       
   150      * Returns this column's style flags
       
   151      */
       
   152     virtual TInt GetStyle() const =0;
       
   153 };
       
   154 
       
   155 
       
   156 class MSwtTableItem
       
   157 {
       
   158 protected:
       
   159     virtual ~MSwtTableItem() {}
       
   160 
       
   161 public:
       
   162     /**
       
   163      * Disposes of (i.e. destroys) the TableItem.
       
   164      */
       
   165     virtual TSwtPeer Dispose() =0;
       
   166 
       
   167     /**
       
   168      * Returns the background at the specified index.
       
   169      */
       
   170     virtual const MSwtColor* GetBackground(TInt aColumnIndex) const =0;
       
   171 
       
   172     /**
       
   173      * Returns the receiver's size and location relative to its parent
       
   174      * @param aColumnIndex  the column index
       
   175      */
       
   176     virtual TRect GetBounds(TInt aColumnIndex) const =0;
       
   177 
       
   178     /**
       
   179      * Returns the check state of the receiver.
       
   180      * If the Table was created without the CHECK style flag, this
       
   181      * method returns EFalse
       
   182      */
       
   183     virtual TBool GetChecked() const =0;
       
   184 
       
   185     /**
       
   186      * Returns the font used at the specified index.
       
   187      */
       
   188     virtual const MSwtFont* GetFont(TInt aColumnIndex) const =0;
       
   189 
       
   190     /**
       
   191      * Returns the foreground at the specified index.
       
   192      */
       
   193     virtual const MSwtColor* GetForeground(TInt aColumnIndex) const =0;
       
   194 
       
   195     /**
       
   196      * Returns the gray state.
       
   197      * If the Table was created without the CHECK style flag, this
       
   198      * method returns EFalse
       
   199      */
       
   200     virtual TBool GetGrayed() const =0;
       
   201 
       
   202     /**
       
   203      * Returns the  size and location of an image, relative to its parent
       
   204      * @param aColumnIndex  the column index
       
   205      */
       
   206     virtual TRect GetImageBounds(TInt aColumnIndex) const =0;
       
   207 
       
   208     /**
       
   209      * Returns the preferred width of the cell at index aColumnIndex,
       
   210      * depending on its font, image and checkbox.
       
   211      */
       
   212     virtual TSize GetPreferredSize(TInt aColumnIndex) const =0;
       
   213 
       
   214     /**
       
   215      * Returns the preferred width of the entire row,
       
   216      * depending on its font, image and checkbox.
       
   217      */
       
   218     virtual TSize GetPreferredSize() const =0;
       
   219 
       
   220     /**
       
   221      * Returns the text of the item, specified by its index.
       
   222      * @param aColumnIndex   the column index
       
   223      * @return The text, cannot be NULL.
       
   224      */
       
   225     virtual const TDesC* GetText(TInt aColumnIndex) const =0;
       
   226 
       
   227     /**
       
   228      * Insert a new column to the row.
       
   229      * No text or images is set. The font used is the default font.
       
   230      */
       
   231     virtual void InsertNewColumnL(TInt aColumnIndex) =0;
       
   232 
       
   233     /**
       
   234      * Remove a column from the row.
       
   235      */
       
   236     virtual void RemoveColumn(TInt aColumnIndex) =0;
       
   237 
       
   238     /**
       
   239      * Sets the background of the cell at index aColumnIndex.
       
   240      */
       
   241     virtual void SetBackground(TInt aColumnIndex, const MSwtColor* aColor) =0;
       
   242 
       
   243     /**
       
   244      * Sets the background for the entire row,
       
   245      */
       
   246     virtual void SetBackgroundForAll(const MSwtColor* aColor) =0;
       
   247 
       
   248     /**
       
   249      * Sets the font of the cell at index aColumnIndex.
       
   250      */
       
   251     virtual void SetFont(TInt aColumnIndex, const MSwtFont* aFont) =0;
       
   252 
       
   253     /**
       
   254      * Sets the font for the entire row.
       
   255      */
       
   256     virtual void SetFontForAll(const MSwtFont* aFont) =0;
       
   257 
       
   258     /**
       
   259      * Sets the foreground of the cell at index aColumnIndex,
       
   260      */
       
   261     virtual void SetForeground(TInt aColumnIndex, const MSwtColor* aColor) =0;
       
   262 
       
   263     /**
       
   264      * Sets the foreground for the entire row.
       
   265      */
       
   266     virtual void SetForegroundForAll(const MSwtColor* aColor) =0;
       
   267 
       
   268     /**
       
   269      * Sets the gray state.
       
   270      * If the Table was created without the CHECK style flag, this
       
   271      * method does nothing.
       
   272      */
       
   273     virtual void SetGrayed(TBool aIsGrayed) =0;
       
   274 
       
   275     /**
       
   276      * Sets an array of texts to the row.
       
   277      */
       
   278     virtual void SetTextArrayL(const CDesCArray* aTextArray) =0;
       
   279 
       
   280     /**
       
   281      * Sets the text to display at the specified index .
       
   282      */
       
   283     virtual void SetTextL(TInt aColumnIndex, const TDesC& aText) =0;
       
   284 
       
   285     /**
       
   286      * Sets an array of images to the row.
       
   287      */
       
   288     virtual void SetImageArray(const RPointerArray<MSwtImage>& aImages) =0;
       
   289 
       
   290     /**
       
   291      * Sets the image at the specified index.
       
   292      */
       
   293     virtual void SetImageByIndex(TInt aColumnIndex, const MSwtImage* aImage) =0;
       
   294 
       
   295     /**
       
   296      * Sets the check state of the receiver.
       
   297      */
       
   298     virtual void  SetChecked(TBool aChecked)=0;
       
   299 
       
   300     /**
       
   301      * Returns the Java Peer.
       
   302      */
       
   303     virtual TSwtPeer JavaPeer() const =0;
       
   304 };
       
   305 
       
   306 
       
   307 /**
       
   308  * Interface class for the org.eclipse.swt.widgets.Table class.
       
   309  */
       
   310 class MSwtTable
       
   311 {
       
   312 protected:
       
   313     virtual ~MSwtTable() {} // Made protected to prevent destruction through the interface
       
   314 
       
   315 public:
       
   316 
       
   317     /**
       
   318      * Returns the MSwtComposite interface
       
   319      */
       
   320     virtual MSwtComposite* Composite() =0;
       
   321 
       
   322     /**
       
   323      * Returns the TableItem array of the Table
       
   324      */
       
   325     virtual CSwtPeerArray* GetTableItemsL() =0;
       
   326 
       
   327     /**
       
   328      * Returns the TableColumn array of the Table
       
   329      */
       
   330     virtual CSwtPeerArray* GetTableColumnsL() =0;
       
   331 
       
   332     /**
       
   333      * Returns an array of TableItems that are currently
       
   334      * selected in the receiver.
       
   335      * Returned array is null if no item is selected.
       
   336      */
       
   337     virtual CSwtPeerArray* GetSelectionL() =0;
       
   338 
       
   339     /**
       
   340      * Register a TableItem
       
   341      * @param aChild the TableItem
       
   342      * @param aRowIndex where to add the TableItem
       
   343      */
       
   344     virtual void AddTableItemL(MSwtTableItem& aChild, TInt aRowIndex) =0;
       
   345 
       
   346     /**
       
   347      * Register a TableColumn
       
   348      * @param aChild the TableColumn
       
   349      * @param aColumnIndex where to add the TableColumn
       
   350      */
       
   351     virtual void AddTableColumnL(MSwtTableColumn& aChild, TInt aColumnIndex) =0;
       
   352 
       
   353     /**
       
   354      * Unregister a TableColumn
       
   355      * @param aChild the TableColumn
       
   356      */
       
   357     virtual void RemoveTableColumn(MSwtTableColumn& aChild) =0;
       
   358 
       
   359     /**
       
   360      * Returns the default font.
       
   361      */
       
   362     virtual const MSwtFont& DefaultFont() const =0;
       
   363 
       
   364     /**
       
   365      * Deselects the items defined in the aIndices array from the <a>Table</a>.
       
   366      * @param aIndices  The array of the items to deselect.
       
   367      * @param aCount   The number of items of this array.
       
   368      */
       
   369     virtual void DeselectItems(const TInt* aIndices, TInt aCount) =0;
       
   370 
       
   371     /**
       
   372      * Deselects the items indexed from aStart to aEnd from the <a>Table</a>.
       
   373      * @param aStart    The first element to deselect.
       
   374      * @param aEnd      The last element to deselect.
       
   375      */
       
   376     virtual void DeselectRange(TInt aStart, TInt aEnd) =0;
       
   377 
       
   378     /**
       
   379      * Searches the receiver's list starting at the first column (index 0)
       
   380      * until a column is found that is equal to the argument, and returns
       
   381      * the index of that column.
       
   382      * @param aColumn the TableColumn
       
   383      * @return the index of the Tablecolumn
       
   384      */
       
   385     virtual TInt IndexOfTableColumn(const MSwtTableColumn *aColumn) const =0;
       
   386 
       
   387     /**
       
   388      * Searches the receiver's list starting at the first item (index 0)
       
   389      * until an item is found that is equal to the argument, and returns
       
   390      * the index of that item.
       
   391      * @param aItem the TableItem
       
   392      * @return the TableItem
       
   393      */
       
   394     virtual TInt IndexOfTableItemAt(const MSwtTableItem *aItem, TInt aStart) const =0;
       
   395 
       
   396     virtual TInt IndexOfTableItem(const MSwtTableItem *aItem) const =0;
       
   397 
       
   398     /**
       
   399      * Returns the number of displayed columns in the Table.
       
   400      * A table with no TableColumn behaves as a List, displaying a dummy column
       
   401      * and therefore the method will return 1. To know the number of TableColumns
       
   402      * in the table, use GetTableColumnCount().
       
   403      * @return the number of columns in the table. Value is always strictly positive
       
   404      */
       
   405     virtual TInt GetColumnCount() const =0;
       
   406 
       
   407     /**
       
   408      * Returns the number of TableColumns in the Table.
       
   409      * A Table with no TableColumn will display a dummy column
       
   410      * and will behave as a list. GetTableColumnCount() will return 0 in that case.
       
   411      * To know how many columns are displayed, use GetColumnCount().
       
   412      * @return the number of TableColumn in the table.
       
   413      */
       
   414     virtual TInt GetTableColumnCount() const =0;
       
   415 
       
   416     /**
       
   417      * Returns ETrue if the receiver's header is visible, and EFalse otherwise.
       
   418      * the value is EFalse by default.
       
   419      * @return  ETrue if the header is visible.
       
   420      */
       
   421     virtual TBool GetHeaderVisible() const =0;
       
   422 
       
   423     /**
       
   424      * Returns ETrue if the item is selected, and EFalse otherwise.
       
   425      */
       
   426     virtual TBool   IsSelected(TInt aIndex) const =0;
       
   427 
       
   428     /**
       
   429      * Returns the column at the given, zero-relative index in the Table.
       
   430      */
       
   431     virtual TSwtPeer GetColumnL(TInt aIndex) const =0;
       
   432 
       
   433     /**
       
   434      * Returns a reference to the array of the alignments of the columns.
       
   435      */
       
   436     virtual const RArray<TInt>& GetColumnAlignments() const =0; // LeaveScan misreport
       
   437 
       
   438     /**
       
   439      * Returns a reference to the array of the widths of the columns.
       
   440      */
       
   441     virtual const RArray<TInt>& GetColumnWidths() const =0;
       
   442 
       
   443     /**
       
   444      * Returns a reference to the array of number of images of the columns.
       
   445      */
       
   446     virtual const RArray<TInt>& GetColumnImageCounts() const =0;
       
   447 
       
   448     /**
       
   449      * Returns the width in pixels of a grid line.
       
   450      */
       
   451     virtual TInt GetGridLineWidth() const =0;
       
   452 
       
   453     /**
       
   454      * Returns the height of the receiver's header
       
   455      */
       
   456     virtual TInt GetHeaderHeight() const =0;
       
   457 
       
   458     /**
       
   459      * Returns the item at the given, zero-relative index in the Table.
       
   460      * @param aIndex the index of the row
       
   461      * @return the item at the given, zero-relative index in the Table.
       
   462      */
       
   463     virtual TSwtPeer GetItemL(TInt aIndex) const =0;
       
   464 
       
   465     /**
       
   466      * Returns the number of items in the Table
       
   467      */
       
   468     virtual TInt GetItemCount() const =0;
       
   469 
       
   470     /**
       
   471      * Returns the rectangle of the specified TableItem, given an index in the Table.
       
   472      * @param aRowIndex the row index of the Table
       
   473      * @return the on-screen rectangle of the specified TableItem.
       
   474      */
       
   475     virtual TRect GetItemRect(TInt aRowIndex) const =0;
       
   476 
       
   477     /**
       
   478      * Returns ETrue if the receiver's lines are visible,
       
   479      * and EFalse otherwise. The default value is EFalse.
       
   480      */
       
   481     virtual TBool GetLinesVisible() const =0;
       
   482 
       
   483     /**
       
   484      * Gets the current selected item. return -1 if no item is selected.
       
   485      */
       
   486     virtual TInt GetSelectionIndex() const =0;
       
   487 
       
   488     /**
       
   489      * Returns the number of selected elements.
       
   490      */
       
   491     virtual TInt GetSelectionCount() const =0;
       
   492 
       
   493     /**
       
   494      * Returns the zero-relative index of the item which is currently
       
   495      * at the top of the receiver.
       
   496      */
       
   497     virtual TInt GetTopIndex() const =0;
       
   498 
       
   499     /**
       
   500      * Get the selected items indices.
       
   501      * @return  An array of indexes owned by the caller.
       
   502      */
       
   503     virtual const CArrayFix<TInt>* GetSelectionIndicesL() const =0;
       
   504 
       
   505     /**
       
   506      * Returns a reference to the image size used in the table.
       
   507      * The image size is the size of the first image added in the table
       
   508      * all other images in the table will use this size.
       
   509      * @return the image size used in the table.
       
   510      */
       
   511     virtual const TSize& ImageSize() const =0;
       
   512 
       
   513     /**
       
   514      * Notifies the Table that an image has been set in the specified column.
       
   515      * @param aColumnIndex the index of the column where an image has been added.
       
   516      */
       
   517     virtual void NotifyImageAdded(TInt aColumnIndex) =0;
       
   518 
       
   519     /**
       
   520      * Notifies the Table that an image has been removed in the specified column.
       
   521      * @param aColumnIndex the index of the column where an image has been removed.
       
   522      */
       
   523     virtual void NotifyImageRemoved(TInt aColumnIndex) =0;
       
   524 
       
   525     /**
       
   526      * Sets the column specified by index to its preferred size.
       
   527      * @param aColumnIndex the index of the Column to pack.
       
   528      */
       
   529     virtual void PackColumn(TInt aColumnIndex) =0;
       
   530 
       
   531     /**
       
   532      * Removes the specified item from the <a>Table</a>.
       
   533      * @param aIndex    The specified item.
       
   534      */
       
   535     virtual void RemoveItemL(TInt aIndex) =0;
       
   536 
       
   537     /**
       
   538      * Removes a range of items from the <a>Table</a>.
       
   539      * @param aStart    The first element to remove.
       
   540      * @param aEnd      The last element to remove.
       
   541      */
       
   542     virtual void RemoveRangeL(TInt aStart, TInt aEnd) =0;
       
   543 
       
   544     /**
       
   545      * Removes the items defined in the aIndices array from the <a>Table</a>.
       
   546      * @param aIndices  The array of the items to remove.
       
   547      * @param aCount    The number of items of this array.
       
   548      */
       
   549     virtual void RemoveItemsL(const TInt* aIndices, TInt aCount) =0;
       
   550 
       
   551     /**
       
   552      * Removes all items from the <a>Table</a>.
       
   553      */
       
   554     virtual void RemoveAll() =0;
       
   555 
       
   556     /**
       
   557      * Selects a single item.
       
   558      * @param aIndex    The item to select.
       
   559      */
       
   560     virtual void SelectItemL(TInt aIndex, TBool aScroll) =0;
       
   561 
       
   562     /**
       
   563      * Selects a range of items.
       
   564      *
       
   565      * @param aStart    The first item to select.
       
   566      * @param aEnd      The last item to select.
       
   567      */
       
   568     virtual void SelectRangeL(TInt aStart, TInt aEnd) =0;
       
   569 
       
   570     /**
       
   571      * Selects all items.
       
   572      */
       
   573     virtual void SelectAllL() =0;
       
   574 
       
   575     /**
       
   576      * Sets the current focused item.
       
   577      *
       
   578      * @param aIndex    The item to focus on.
       
   579      */
       
   580     virtual void SetFocusIndex(TInt aIndex) =0;
       
   581 
       
   582     /**
       
   583      * update the text of the column
       
   584      * @param aTableColumn the TableColumn to set the text.
       
   585      * @param aText the text to set
       
   586      */
       
   587     virtual void SetColumnTextL(MSwtTableColumn& aTableColumn, const TDesC& aText) =0;
       
   588 
       
   589     /**
       
   590      * return the text of the column
       
   591      * @param aColumnIndex the index of the column to get the text
       
   592      */
       
   593     virtual const TDesC& GetColumnText(TInt aColumnIndex) const =0;
       
   594 
       
   595     /**
       
   596      * Marks the receiver's header as visible if the argument is ETrue,
       
   597      * and marks it invisible otherwise
       
   598      * @param aShow the column visibility
       
   599      */
       
   600     virtual void SetHeaderVisible(TBool aShow) =0;
       
   601 
       
   602     /**
       
   603      * Sets the image size of the table, if the image size is currently TSize(0, 0).
       
   604      * @param aSize         The size of the image.
       
   605      * @param aAddedToItem  Should be EFalse if image is being added to TableColumn.
       
   606      *                      In this case item height is not updated.
       
   607      */
       
   608     virtual void SetTableImageSizeIfNotDefined(const TSize& aSize,
       
   609             const TBool& aAddedToItem = ETrue) = 0;
       
   610 
       
   611     /**
       
   612      * Marks the receiver's lines as visible if the argument is true,
       
   613      * and marks it invisible otherwise
       
   614      * @param aShow the grid visibility
       
   615      */
       
   616     virtual void SetLinesVisible(TBool aShow) =0;
       
   617 
       
   618     /**
       
   619      * Sets the zero-relative index of the item which is currently at the top of the receiver.
       
   620      * @param aIndex the index of the row to set on top in the Table
       
   621      */
       
   622     virtual void SetTopIndex(TInt aIndex) =0;
       
   623 
       
   624     /**
       
   625      * Shows the selection.
       
   626      */
       
   627     virtual void ShowSelection() =0;
       
   628 
       
   629     /**
       
   630      * return the width of a column in the table
       
   631      * @param aColumnIndex the index of the column
       
   632      * @return the width of a column in the table
       
   633      */
       
   634     virtual TInt GetColumnWidth(TInt aColumnIndex) const =0;
       
   635 
       
   636     /**
       
   637      * Return the column alignment of a column in the table.
       
   638      * First column is always left aligned.
       
   639      * @param aColumnIndex the index of the column
       
   640      * @return the alignment of the column, of type CGraphicsContext::TTextAlign
       
   641      */
       
   642     virtual TInt GetColumnAlignment(TInt aColumnIndex) =0;
       
   643 
       
   644     /**
       
   645      * set the width in pixel of a column in the table
       
   646      * @param aColumnIndex the index of the column
       
   647      * @param aWidth the width in pixel
       
   648      */
       
   649     virtual void SetColumnWidth(TInt aColumnIndex, TInt aWidth) =0;
       
   650 
       
   651     /**
       
   652      * set the column alignment of a column in the table
       
   653      * @param aColumnIndex the index of the column.
       
   654      * @param aAlignment the column's alignment, of type CGraphicsContext::TTextAlign
       
   655      */
       
   656     virtual  void SetColumnAlignment(TInt aColumnIndex, TInt aAlignment) =0;
       
   657 
       
   658     /**
       
   659      * Updates the height of the rows if necessary.
       
   660      * @param aChangedFontHeight New relevant height.
       
   661      */
       
   662     virtual void UpdateItemHeight(const TInt& aChangedFontHeight) =0;
       
   663 
       
   664     /**
       
   665      * Show the TableColumn
       
   666      * @param aTableColumn the TableColumn to show
       
   667      */
       
   668     virtual void ShowTableColumn(MSwtTableColumn& aTableColumn) =0;
       
   669 
       
   670     /**
       
   671      * Show the TableItem
       
   672      * @param aTableItem the TableItem to show
       
   673      */
       
   674     virtual void ShowTableItem(MSwtTableItem& aTableItem) =0;
       
   675 
       
   676     /**
       
   677      * Return the height of a TableItem, in pixels. All TableItem have the same height.
       
   678      * @return the item Height
       
   679      */
       
   680     virtual TInt GetItemHeight() const =0;
       
   681 
       
   682     /**
       
   683      * Returns the item at the given point in the receiver, or null if no such item exists.
       
   684      * @param aPoint a point in the receiver
       
   685      * @return The TableItem peer under this point
       
   686      */
       
   687     virtual TSwtPeer GetItemFromPoint(TPoint &aPoint) const =0;
       
   688 
       
   689     /**
       
   690      * set the image of a column in the Table (will appear on the header)
       
   691      * @param aColumnIndex the index of the column
       
   692      * @param aImage the image to set in the column
       
   693      */
       
   694     virtual void SetColumnImage(TInt aColumnIndex, const MSwtImage* aImage) =0;
       
   695 };
       
   696 
       
   697 
       
   698 /**
       
   699  * Interface class for the org.eclipse.swt.widgets.Tree class.
       
   700  */
       
   701 class MSwtTree
       
   702 {
       
   703 protected:
       
   704     virtual ~MSwtTree() {} // Made protected to prevent destruction through the interface
       
   705 
       
   706 public:
       
   707     virtual MSwtComposite* Composite() = 0;
       
   708     MSwtScrollable* Scrollable()
       
   709     {
       
   710         return Composite()->Scrollable();
       
   711     }
       
   712     MSwtControl* Control()
       
   713     {
       
   714         return Composite()->Control();
       
   715     }
       
   716     virtual TInt AddL(TInt aItemHandle) = 0;
       
   717     virtual TRect Bounds(TInt aItemHandle) const = 0;
       
   718     virtual void Check(TInt aItemHandle, TBool aState) = 0;
       
   719     virtual void Collapse(TInt aItemHandle) = 0;
       
   720     virtual void Expand(TInt aItemHandle) = 0;
       
   721     virtual TInt InsertL(TInt aItemHandle, TInt aIndex) = 0;
       
   722     virtual TBool IsExpanded(TInt aItemHandle) const = 0;
       
   723     virtual TBool IsSelected(TInt aItemHandle) const = 0;
       
   724     virtual TInt ItemAt(TInt aX, TInt aY) const = 0;
       
   725     virtual TInt ItemHeight() const = 0;
       
   726     virtual void Remove(TInt aItemHandle) = 0;
       
   727     virtual void RemoveAll() = 0;
       
   728     virtual void Select(const TInt* aItemHandles, TInt aCount, TBool aState) = 0;
       
   729     virtual void SelectAll(TBool aState) = 0;
       
   730     virtual const CArrayFix<TInt>* SelectionL() const = 0;
       
   731     virtual TInt SelectionCount() const = 0;
       
   732     virtual void SetImageL(TInt aItemHandle, const MSwtImage* aImage) = 0;
       
   733     virtual void SetTextL(TInt aItemHandle, const TDesC& aText) = 0;
       
   734     virtual TInt TopItem() const = 0;
       
   735 };
       
   736 
       
   737 
       
   738 /**
       
   739  * Interface class for the org.eclipse.swt.widgets.FontDialog class.
       
   740  */
       
   741 class MSwtFontDialog
       
   742 {
       
   743 protected:
       
   744     virtual ~MSwtFontDialog() {} // Made protected to prevent destruction through the interface
       
   745 
       
   746 public:
       
   747     /**
       
   748      * Initializes the FontDialog object in order to prepare the display with the selected font.
       
   749      */
       
   750     virtual void SetInitialSelection(const TDesC* aName, TInt aHeight, TInt aStyle) =0;
       
   751 
       
   752     /**
       
   753      * Sets the initial font color.
       
   754      */
       
   755     virtual void SetInitialRGB(TInt aRed, TInt aGreen, TInt aBlue) =0;
       
   756 
       
   757     /**
       
   758      * Displays the dialog.
       
   759      */
       
   760     virtual TBool OpenL() =0;
       
   761 
       
   762     /**
       
   763      * Simple getter. Returns the selected font name or null if none was selected.
       
   764      */
       
   765     virtual const TDesC* GetFontName() const = 0;
       
   766 
       
   767     /**
       
   768      * Simple getter. Returns the selected font size.
       
   769      */
       
   770     virtual TInt GetFontHeight() const = 0;
       
   771 
       
   772     /**
       
   773      * Simple getter. Returns the selected font style.
       
   774      */
       
   775     virtual TInt GetFontStyle() const = 0;
       
   776 
       
   777     /**
       
   778      * Simple getter. Returns the selected font color.
       
   779      */
       
   780     virtual TInt GetFontRGB() const = 0;
       
   781 
       
   782     /**
       
   783      * Disposes (delete) the font object.
       
   784      */
       
   785     virtual void Dispose() =0;
       
   786 };
       
   787 
       
   788 
       
   789 /**
       
   790  * Interface class for the DirectoryDialog java class.
       
   791  */
       
   792 class MSwtDirectoryDialog
       
   793 {
       
   794 protected:
       
   795     virtual ~MSwtDirectoryDialog() {}
       
   796 
       
   797 public:
       
   798     /**
       
   799      * Displays the dialog.
       
   800      * @return A buffer containing the path and filename of the selected file,
       
   801      *         or NULL if Cancel button is used to close the dialog. The user
       
   802      *         has to release this buffer.
       
   803      */
       
   804     virtual HBufC* OpenLD() =0;
       
   805 };
       
   806 
       
   807 
       
   808 /**
       
   809  * Interface class for the org.eclipse.swt.widgets.Browser class
       
   810  * A class that implements MSwtBrowser must also implement MSwtConposite.
       
   811  */
       
   812 class MSwtBrowser
       
   813 {
       
   814 protected:
       
   815     /**
       
   816      * Destructor
       
   817      */
       
   818     virtual ~MSwtBrowser() {} // Made protected to prevent destruction through the interface
       
   819 
       
   820 public:
       
   821 
       
   822     /**
       
   823      * @returns the MSwtComposite interface
       
   824      */
       
   825     virtual MSwtComposite* Composite() = 0;
       
   826 
       
   827     /**
       
   828      * @returns the MSwtScrollable interface
       
   829      */
       
   830     MSwtScrollable* Scrollable()
       
   831     {
       
   832         return Composite()->Scrollable();
       
   833     }
       
   834 
       
   835     /**
       
   836      * @returns the MSwtControl interface
       
   837      */
       
   838     MSwtControl* Control()
       
   839     {
       
   840         return Composite()->Control();
       
   841     }
       
   842 
       
   843     /**
       
   844      * Navigates to previous URL from history.
       
   845      * @return ETrue if back command was sent to browser contorl without error, and EFalse otherwise.
       
   846      */
       
   847     virtual TBool BackL() = 0;
       
   848 
       
   849     /**
       
   850      * Navigates to next URL from history
       
   851      * @return ETrue if forward command was sent to browser contorl without error, and EFalse otherwise.
       
   852      */
       
   853     virtual TBool ForwardL() = 0;
       
   854 
       
   855     /**
       
   856      * Get current URL
       
   857      * @return the Pointer to the current URL
       
   858      */
       
   859     virtual HBufC* GetUrlL() = 0;
       
   860 
       
   861     /**
       
   862      * Get availability of previous session history item
       
   863      * @return ETrue if previous session history item is available, and EFalse otherwise.
       
   864      */
       
   865     virtual TBool IsBackEnabled() const = 0;
       
   866 
       
   867     /**
       
   868      * Get availability of next session history item
       
   869      * @return ETrue if next session history item is available, and EFalse otherwise.
       
   870      */
       
   871     virtual TBool IsForwardEnabled() const = 0;
       
   872 
       
   873     /**
       
   874      * Refresh the current page
       
   875      * @return void.
       
   876      */
       
   877     virtual void  RefreshL() = 0;
       
   878 
       
   879     /**
       
   880      * Stop any loading and rendering activity
       
   881      * @return void.
       
   882      */
       
   883     virtual void  StopL() = 0;
       
   884 
       
   885     /**
       
   886      * Renders HTML.
       
   887      * @return ETrue if the operation was successful and EFalse otherwise. .
       
   888      */
       
   889     virtual TBool SetTextL(const TDesC&  aHtml) = 0;
       
   890 
       
   891     /**
       
   892      * Loads a URL.
       
   893      * @return ETrue if the operation was successful and EFalse otherwise. .
       
   894      */
       
   895     virtual TBool SetUrlL(const TDesC&  aUrl) = 0;
       
   896 
       
   897     /**
       
   898      * Load a URL based on the @param aOperationType. The function must be called by callback event framework.
       
   899      * Don't call it from anywhere else
       
   900      * @param aUrl,the URL to load
       
   901      * @param  aOperationType, the loading operation type
       
   902      * @return void
       
   903      */
       
   904     virtual void  DoSetUrlL(const TDesC&  aUrl, TSwtBrCallBackOperationType aOperationType) = 0;
       
   905 
       
   906     /**
       
   907      * Handles free ram memory event.
       
   908      * @param aEventType The type of event.
       
   909      * @return void.
       
   910      */
       
   911     virtual void HandleFreeRamEventL(TInt aEventType) = 0;
       
   912 };
       
   913 
       
   914 #endif // ESWTWIDGETSEXPANDED_H