foobar2000 SDK  2015-08-03
inplace_edit_v2.h
Go to the documentation of this file.
1 namespace InPlaceEdit {
2  class NOVTABLE CTableEditHelperV2 : protected completion_notify_receiver {
3  public:
4  virtual RECT TableEdit_GetItemRect(t_size item, t_size subItem) const = 0;
5  virtual void TableEdit_GetField(t_size item, t_size subItem, pfc::string_base & out, t_size & lineCount) = 0;
6  virtual void TableEdit_SetField(t_size item, t_size subItem, const char * value) = 0;
7  virtual HWND TableEdit_GetParentWnd() const = 0;
8  virtual bool TableEdit_Advance(t_size & item, t_size & subItem, t_uint32 whathappened);
9  virtual void TableEdit_Finished() {}
10  virtual t_size TableEdit_GetItemCount() const = 0;
11  virtual t_size TableEdit_GetColumnCount() const = 0;
12  virtual void TableEdit_SetItemFocus(t_size item, t_size subItem) = 0;
13  virtual bool TableEdit_IsColumnEditable(t_size subItem) const {return true;}
14  virtual void TableEdit_GetColumnOrder(t_size * out, t_size count) const {order_helper::g_fill(out,count);}
15  virtual t_uint32 TableEdit_GetEditFlags(t_size item, t_size subItem) const {return 0;}
16  virtual bool TableEdit_GetAutoComplete(t_size item, t_size subItem, pfc::com_ptr_t<IUnknown> & out) {return false;}
17  void TableEdit_Start(t_size item, t_size subItem);
18  void TableEdit_Abort(bool forwardContent);
19  bool TableEdit_IsActive() const {return have_task(KTaskID);}
20  protected:
21  void on_task_completion(unsigned p_id,unsigned p_status);
22  private:
23  t_size ColumnToPosition(t_size col) const;
24  t_size PositionToColumn(t_size pos) const;
25  t_size EditableColumnCount() const;
26  void GrabColumnOrder(pfc::array_t<t_size> & buffer) const {buffer.set_size(TableEdit_GetColumnCount()); TableEdit_GetColumnOrder(buffer.get_ptr(), buffer.get_size());}
27  void _ReStart();
28 
29  t_size m_editItem, m_editSubItem;
32  static const unsigned KTaskID = 0x6f0a3de6;
33  };
34 
35 
36 
37 
39  public:
40  RECT TableEdit_GetItemRect(t_size item, t_size subItem) const;
41  void TableEdit_GetField(t_size item, t_size subItem, pfc::string_base & out, t_size & lineCount);
42  void TableEdit_SetField(t_size item, t_size subItem, const char * value);
43 
44  t_size TableEdit_GetColumnCount() const {return (t_size) ListView_GetColumnCount(TableEdit_GetParentWnd());}
45 
46  t_size TableEdit_GetItemCount() const;
47  void TableEdit_SetItemFocus(t_size item, t_size subItem);
48 
49  void TableEdit_GetColumnOrder(t_size * out, t_size count) const;
50  };
51 }
virtual t_uint32 TableEdit_GetEditFlags(t_size item, t_size subItem) const
const t_item * get_ptr() const
Definition: array.h:213
static void g_fill(t_int *p_order, const t_size p_count)
Definition: order_helper.h:38
virtual bool TableEdit_GetAutoComplete(t_size item, t_size subItem, pfc::com_ptr_t< IUnknown > &out)
int ListView_GetColumnCount(HWND listView)
size_t t_size
Definition: int_types.h:48
void set_size(t_size p_size)
Definition: array.h:104
pfc::rcptr_t< pfc::string8 > m_editData
virtual bool TableEdit_IsColumnEditable(t_size subItem) const
virtual void TableEdit_GetColumnOrder(t_size *out, t_size count) const
Helper base class for classes that manage nonblocking tasks and get notified back thru completion_not...
void GrabColumnOrder(pfc::array_t< t_size > &buffer) const
t_size get_size() const
Definition: array.h:130
uint32_t t_uint32
Definition: int_types.h:5