/***************************************************************************
 *                          Zanoza Modeler v2.x                            *
 *      This is unpublished propietary source code of Zanoza Software.     *
 *      The copyright notice does not evidence any actual or intended      *
 *                    publication of such source code.                     *
 *                                                                         *
 *                   Copyright (c) 2002 Zanoza Software.                   *
 *                                                                         *
 *                        All rights reserved.                             *
 ***************************************************************************
 *--------------------------------------------------------------------------
 * @author:   Oleg Melashenko
 *--------------------------------------------------------------------------
 * @purpose:  Declaration of the class IListControl
 *   Improved List control.
 *--------------------------------------------------------------------------
 * @created: 6 мая 2004 г. 12:56:47
 */

#if !defined(IListControl_h_included)
#define IListControl_h_included
//forward declaration of this class might require
namespace core
{ namespace ui
  { namespace controls
    { class IListControl; }; }; };
#include <zmodeler.h>
#include <core/ui/controls/uiControls.h>
#include <core/ui/controls/IUIControl.h>
#include <core/ui/controls/IListElementController.h>


namespace core
{
  namespace ui
  {
    namespace controls
    {
      
      class IListControl : public core::ui::controls::IUIControl
      {
      public:
        virtual long getItemCount(void) const=0;
        /* Prepares list for a number of items to be added */
        virtual ZRESULT setItemCount(long items)=0;
        virtual long getItemOrdinal(long nIndex)=0;
        virtual long getOrdinalIndex(long nOrdinal)=0;
        virtual ZRESULT getSelectedItems(tLongSeq& items)=0;
        virtual ZRESULT isSelected(long nOrdinal)=0;
        /* Provides check-status : 0 if not checked, 1 if checked, 2 in intermediate state */
        virtual long getCheck(long nOrdinal)=0;
        virtual ZRESULT selectItem(long nOrdinal, bool bSelect=true)=0;
        virtual ZRESULT checkItem(long nOrdinal, long nCheck=1, bool bAllowIntermediate=false)=0;
        virtual ZRESULT getItemText(long nOrdinal, ZString& text)=0;
        virtual ZRESULT setItemText(long nOrdinal, ZString text)=0;
        virtual ZRESULT getItemData(long nOrdinal, DWORD& data)=0;
        virtual ZRESULT setItemData(long nOrdinal, DWORD data)=0;
        /* Modifies item style. Item's style surpresses control style and, if any, column style */
        virtual ZRESULT modifyItemStyle(long nOrdinal, DWORD dwAdd, DWORD dwRemove, DWORD* pdwCurrent=NULL)=0;
        virtual ZRESULT insertItem(long index, ZString strLabel, long* pItemID, CImageList* pList=NULL, long nImage=0, core::ui::controls::IListElementController* pController=NULL)=0;
        virtual ZRESULT addItem(ZString strLabel, long* pItemID, CImageList* pList=NULL, long nImage=0, core::ui::controls::IListElementController* pController=NULL)=0;
        /* Modifies components of an item. Label, image, controller. */
        virtual ZRESULT modifyItem(long nItemID, LPCTSTR pszLabel, CImageList* pList=NULL, long nImage=-1)=0;
        virtual ZRESULT deleteItem(long nOrdinal)=0;
        virtual ZRESULT getController(core::ui::controls::IListElementController** ppController)=0;
        virtual ZRESULT setController(core::ui::controls::IListElementController* pController, bool bHoldRef=true)=0;
      
      };//class IListControl
    };//controls
  };//ui
};//core

#endif
