foobar2000 SDK  2015-08-03
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
InPlaceEdit::CTableEditHelperV2abstract

#include <inplace_edit_v2.h>

+ Inheritance diagram for InPlaceEdit::CTableEditHelperV2:

Public Member Functions

void TableEdit_Abort (bool forwardContent)
 
virtual bool TableEdit_Advance (t_size &item, t_size &subItem, t_uint32 whathappened)
 
virtual void TableEdit_Finished ()
 
virtual bool TableEdit_GetAutoComplete (t_size item, t_size subItem, pfc::com_ptr_t< IUnknown > &out)
 
virtual t_size TableEdit_GetColumnCount () const =0
 
virtual void TableEdit_GetColumnOrder (t_size *out, t_size count) const
 
virtual t_uint32 TableEdit_GetEditFlags (t_size item, t_size subItem) const
 
virtual void TableEdit_GetField (t_size item, t_size subItem, pfc::string_base &out, t_size &lineCount)=0
 
virtual t_size TableEdit_GetItemCount () const =0
 
virtual RECT TableEdit_GetItemRect (t_size item, t_size subItem) const =0
 
virtual HWND TableEdit_GetParentWnd () const =0
 
bool TableEdit_IsActive () const
 
virtual bool TableEdit_IsColumnEditable (t_size subItem) const
 
virtual void TableEdit_SetField (t_size item, t_size subItem, const char *value)=0
 
virtual void TableEdit_SetItemFocus (t_size item, t_size subItem)=0
 
void TableEdit_Start (t_size item, t_size subItem)
 

Protected Member Functions

void on_task_completion (unsigned p_id, unsigned p_status)
 
- Protected Member Functions inherited from completion_notify_receiver
 ~completion_notify_receiver ()
 
completion_notify::ptr create_or_get_task (unsigned p_id)
 
completion_notify_ptr create_task (unsigned p_id)
 
bool have_task (unsigned p_id) const
 
void orphan_all_tasks ()
 
void orphan_task (unsigned p_id)
 

Private Member Functions

void _ReStart ()
 
t_size ColumnToPosition (t_size col) const
 
t_size EditableColumnCount () const
 
void GrabColumnOrder (pfc::array_t< t_size > &buffer) const
 
t_size PositionToColumn (t_size pos) const
 

Private Attributes

pfc::rcptr_t< pfc::string8m_editData
 
t_uint32 m_editFlags
 
t_size m_editItem
 
t_size m_editSubItem
 

Static Private Attributes

static const unsigned KTaskID = 0x6f0a3de6
 

Detailed Description

Definition at line 2 of file inplace_edit_v2.h.

Member Function Documentation

void InPlaceEdit::CTableEditHelperV2::_ReStart ( )
private

Definition at line 71 of file inplace_edit_v2.cpp.

71  {
72  PFC_ASSERT( m_editItem < TableEdit_GetItemCount() );
73  PFC_ASSERT( m_editSubItem < TableEdit_GetColumnCount() );
74 
76  m_editData.new_t();
77  t_size lineCount = 1;
80 
82  if (lineCount > 1) {
83  rc.bottom = rc.top + (rc.bottom - rc.top) * lineCount;
85  }
88 
90  }
virtual t_uint32 TableEdit_GetEditFlags(t_size item, t_size subItem) const
void new_t()
Definition: rcptr.h:101
T * get_ptr() const
Definition: com_ptr_t.h:49
virtual t_size TableEdit_GetColumnCount() const =0
virtual t_size TableEdit_GetItemCount() const =0
virtual bool TableEdit_GetAutoComplete(t_size item, t_size subItem, pfc::com_ptr_t< IUnknown > &out)
static const unsigned KTaskID
size_t t_size
Definition: int_types.h:48
pfc::rcptr_t< pfc::string8 > m_editData
HWND StartEx(HWND p_parentwnd, const RECT &p_rect, unsigned p_flags, pfc::rcptr_t< pfc::string_base > p_content, completion_notify_ptr p_notify, IUnknown *ACData=NULL, DWORD ACOpts=0)
completion_notify_ptr create_task(unsigned p_id)
virtual HWND TableEdit_GetParentWnd() const =0
void release()
Definition: com_ptr_t.h:41
virtual void TableEdit_SetItemFocus(t_size item, t_size subItem)=0
virtual RECT TableEdit_GetItemRect(t_size item, t_size subItem) const =0
virtual void TableEdit_GetField(t_size item, t_size subItem, pfc::string_base &out, t_size &lineCount)=0
t_size InPlaceEdit::CTableEditHelperV2::ColumnToPosition ( t_size  col) const
private

Definition at line 5 of file inplace_edit_v2.cpp.

5  {
6  PFC_ASSERT( TableEdit_IsColumnEditable(col) );
7  pfc::array_t<t_size> colOrder; GrabColumnOrder(colOrder);
8  t_size skipped = 0;
9  for(t_size walk = 0; walk < colOrder.get_size(); ++walk) {
10  const t_size curCol = colOrder[walk];
11  if (TableEdit_IsColumnEditable(curCol)) {
12  if (curCol == col) return skipped;
13  ++skipped;
14  }
15  }
16  PFC_ASSERT( !"Should not get here." );
17  return ~0;
18  }
size_t t_size
Definition: int_types.h:48
virtual bool TableEdit_IsColumnEditable(t_size subItem) const
void GrabColumnOrder(pfc::array_t< t_size > &buffer) const
t_size get_size() const
Definition: array.h:130
t_size InPlaceEdit::CTableEditHelperV2::EditableColumnCount ( ) const
private

Definition at line 32 of file inplace_edit_v2.cpp.

32  {
33  const t_size total = TableEdit_GetColumnCount();
34  t_size found = 0;
35  for(t_size walk = 0; walk < total; ++walk) {
36  if (TableEdit_IsColumnEditable(walk)) found++;
37  }
38  return found;
39  }
virtual t_size TableEdit_GetColumnCount() const =0
size_t t_size
Definition: int_types.h:48
virtual bool TableEdit_IsColumnEditable(t_size subItem) const
void InPlaceEdit::CTableEditHelperV2::GrabColumnOrder ( pfc::array_t< t_size > &  buffer) const
inlineprivate

Definition at line 26 of file inplace_edit_v2.h.

const t_item * get_ptr() const
Definition: array.h:213
virtual t_size TableEdit_GetColumnCount() const =0
void set_size(t_size p_size)
Definition: array.h:104
virtual void TableEdit_GetColumnOrder(t_size *out, t_size count) const
t_size get_size() const
Definition: array.h:130
void InPlaceEdit::CTableEditHelperV2::on_task_completion ( unsigned  p_id,
unsigned  p_status 
)
protectedvirtual

Reimplemented from completion_notify_receiver.

Definition at line 92 of file inplace_edit_v2.cpp.

92  {
93  if (id == KTaskID) {
95  if (m_editData.is_valid()) {
98  }
100  }
101 
103  _ReStart();
104  } else {
106  }
107  }
108  }
void orphan_task(unsigned p_id)
virtual void TableEdit_SetField(t_size item, t_size subItem, const char *value)=0
static const unsigned KTaskID
pfc::rcptr_t< pfc::string8 > m_editData
void release()
Definition: rcptr.h:86
virtual bool TableEdit_Advance(t_size &item, t_size &subItem, t_uint32 whathappened)
bool is_valid() const
Definition: rcptr.h:80
t_size InPlaceEdit::CTableEditHelperV2::PositionToColumn ( t_size  pos) const
private

Definition at line 19 of file inplace_edit_v2.cpp.

19  {
20  pfc::array_t<t_size> colOrder; GrabColumnOrder(colOrder);
21  t_size skipped = 0;
22  for(t_size walk = 0; walk < colOrder.get_size(); ++walk) {
23  const t_size curCol = colOrder[walk];
24  if (TableEdit_IsColumnEditable(curCol)) {
25  if (skipped == pos) return curCol;
26  ++skipped;
27  }
28  }
29  PFC_ASSERT( !"Should not get here." );
30  return ~0;
31  }
size_t t_size
Definition: int_types.h:48
virtual bool TableEdit_IsColumnEditable(t_size subItem) const
void GrabColumnOrder(pfc::array_t< t_size > &buffer) const
t_size get_size() const
Definition: array.h:130
void InPlaceEdit::CTableEditHelperV2::TableEdit_Abort ( bool  forwardContent)

Definition at line 49 of file inplace_edit_v2.cpp.

49  {
50  if (this->have_task(KTaskID)) {
51  this->orphan_task(KTaskID);
52  if (forwardContent && (m_editFlags & KFlagReadOnly) == 0) {
53  if (m_editData.is_valid()) {
54  pfc::string8 temp(*m_editData);
56  }
57  }
59  SetFocus(NULL);
61  }
62 
63  }
bool have_task(unsigned p_id) const
void orphan_task(unsigned p_id)
virtual void TableEdit_SetField(t_size item, t_size subItem, const char *value)=0
static const unsigned KTaskID
pfc::rcptr_t< pfc::string8 > m_editData
void release()
Definition: rcptr.h:86
bool is_valid() const
Definition: rcptr.h:80
bool InPlaceEdit::CTableEditHelperV2::TableEdit_Advance ( t_size item,
t_size subItem,
t_uint32  whathappened 
)
virtual

Definition at line 41 of file inplace_edit_v2.cpp.

41  {
42  //moo
43  unsigned _item((unsigned)item), _subItem((unsigned)ColumnToPosition(subItem));
44  if (!InPlaceEdit::TableEditAdvance(_item,_subItem,(unsigned) TableEdit_GetItemCount(), (unsigned) EditableColumnCount(), whathappened)) return false;
45  item = _item; subItem = PositionToColumn(_subItem);
46  return true;
47  }
t_size ColumnToPosition(t_size col) const
t_size PositionToColumn(t_size pos) const
virtual t_size TableEdit_GetItemCount() const =0
bool TableEditAdvance(unsigned &p_item, unsigned &p_column, unsigned p_item_count, unsigned p_column_count, unsigned p_whathappened)
virtual void InPlaceEdit::CTableEditHelperV2::TableEdit_Finished ( )
inlinevirtual

Definition at line 9 of file inplace_edit_v2.h.

9 {}
virtual bool InPlaceEdit::CTableEditHelperV2::TableEdit_GetAutoComplete ( t_size  item,
t_size  subItem,
pfc::com_ptr_t< IUnknown > &  out 
)
inlinevirtual

Definition at line 16 of file inplace_edit_v2.h.

16 {return false;}
virtual t_size InPlaceEdit::CTableEditHelperV2::TableEdit_GetColumnCount ( ) const
pure virtual
virtual void InPlaceEdit::CTableEditHelperV2::TableEdit_GetColumnOrder ( t_size out,
t_size  count 
) const
inlinevirtual

Reimplemented in InPlaceEdit::CTableEditHelperV2_ListView.

Definition at line 14 of file inplace_edit_v2.h.

14 {order_helper::g_fill(out,count);}
static void g_fill(t_int *p_order, const t_size p_count)
Definition: order_helper.h:38
virtual t_uint32 InPlaceEdit::CTableEditHelperV2::TableEdit_GetEditFlags ( t_size  item,
t_size  subItem 
) const
inlinevirtual

Definition at line 15 of file inplace_edit_v2.h.

15 {return 0;}
virtual void InPlaceEdit::CTableEditHelperV2::TableEdit_GetField ( t_size  item,
t_size  subItem,
pfc::string_base out,
t_size lineCount 
)
pure virtual
virtual t_size InPlaceEdit::CTableEditHelperV2::TableEdit_GetItemCount ( ) const
pure virtual
virtual RECT InPlaceEdit::CTableEditHelperV2::TableEdit_GetItemRect ( t_size  item,
t_size  subItem 
) const
pure virtual
virtual HWND InPlaceEdit::CTableEditHelperV2::TableEdit_GetParentWnd ( ) const
pure virtual
bool InPlaceEdit::CTableEditHelperV2::TableEdit_IsActive ( ) const
inline

Definition at line 19 of file inplace_edit_v2.h.

19 {return have_task(KTaskID);}
bool have_task(unsigned p_id) const
static const unsigned KTaskID
virtual bool InPlaceEdit::CTableEditHelperV2::TableEdit_IsColumnEditable ( t_size  subItem) const
inlinevirtual

Definition at line 13 of file inplace_edit_v2.h.

13 {return true;}
virtual void InPlaceEdit::CTableEditHelperV2::TableEdit_SetField ( t_size  item,
t_size  subItem,
const char *  value 
)
pure virtual
virtual void InPlaceEdit::CTableEditHelperV2::TableEdit_SetItemFocus ( t_size  item,
t_size  subItem 
)
pure virtual
void InPlaceEdit::CTableEditHelperV2::TableEdit_Start ( t_size  item,
t_size  subItem 
)

Definition at line 65 of file inplace_edit_v2.cpp.

65  {
66  PFC_ASSERT( TableEdit_IsColumnEditable( subItem ) );
67  m_editItem = item; m_editSubItem = subItem;
68  _ReStart();
69  }
virtual bool TableEdit_IsColumnEditable(t_size subItem) const

Field Documentation

const unsigned InPlaceEdit::CTableEditHelperV2::KTaskID = 0x6f0a3de6
staticprivate

Definition at line 32 of file inplace_edit_v2.h.

pfc::rcptr_t<pfc::string8> InPlaceEdit::CTableEditHelperV2::m_editData
private

Definition at line 31 of file inplace_edit_v2.h.

t_uint32 InPlaceEdit::CTableEditHelperV2::m_editFlags
private

Definition at line 30 of file inplace_edit_v2.h.

t_size InPlaceEdit::CTableEditHelperV2::m_editItem
private

Definition at line 29 of file inplace_edit_v2.h.

t_size InPlaceEdit::CTableEditHelperV2::m_editSubItem
private

Definition at line 29 of file inplace_edit_v2.h.


The documentation for this class was generated from the following files: