foobar2000 SDK  2015-08-03
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes
InPlaceEdit::CTableEditHelper

#include <inplace_edit.h>

Public Member Functions

 ~CTableEditHelper ()
 
void on_task_completion (unsigned p_taskid, unsigned p_state)
 
void TableEdit_Abort (bool p_forwardcontent)
 
virtual void TableEdit_Finished ()
 
virtual bool TableEdit_GetItemText (unsigned p_item, unsigned p_column, pfc::string_base &p_out, unsigned &p_linecount)
 
bool TableEdit_IsActive () const
 
virtual void TableEdit_SetItemText (unsigned p_item, unsigned p_column, const char *p_text)
 
void TableEdit_Start (HWND p_listview, unsigned p_item, unsigned p_column, unsigned p_itemcount, unsigned p_columncount, unsigned p_basecolumn, unsigned p_flags=0)
 

Protected Member Functions

HWND TableEdit_GetListView () const
 
virtual bool TableEdit_OnEditCompleted (unsigned item, unsigned column, unsigned state)
 

Private Types

enum  { KTaskID = 0xc0ffee }
 

Private Member Functions

void __Start ()
 

Private Attributes

unsigned m_basecolumn
 
unsigned m_column
 
unsigned m_columncount
 
pfc::rcptr_t< pfc::string8m_content
 
unsigned m_flags
 
unsigned m_item
 
unsigned m_itemcount
 
HWND m_listview
 
service_ptr_t< completion_notify_orphanablem_notify
 

Detailed Description

Definition at line 30 of file inplace_edit.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
KTaskID 

Definition at line 117 of file inplace_edit.h.

117  {
118  KTaskID = 0xc0ffee
119  };

Constructor & Destructor Documentation

InPlaceEdit::CTableEditHelper::~CTableEditHelper ( )
inline

Definition at line 98 of file inplace_edit.h.

98  {
99  if (m_notify.is_valid()) {
100  m_notify->orphan();
101  m_notify.release();
102  }
103  }
service_ptr_t< completion_notify_orphanable > m_notify
Definition: inplace_edit.h:125
bool is_valid() const
Definition: service.h:119
void release()
Definition: service.h:109

Member Function Documentation

void InPlaceEdit::CTableEditHelper::__Start ( )
inlineprivate

Definition at line 109 of file inplace_edit.h.

109  {
111  m_content.new_t();
112  unsigned linecount = 1;
113  if (!TableEdit_GetItemText(m_item,m_column,*m_content,linecount)) return;
116  }
void new_t()
Definition: rcptr.h:101
virtual bool TableEdit_GetItemText(unsigned p_item, unsigned p_column, pfc::string_base &p_out, unsigned &p_linecount)
Definition: inplace_edit.h:68
service_ptr_t< completion_notify_orphanable > m_notify
Definition: inplace_edit.h:125
service_nnptr_t< completion_notify_orphanable > completion_notify_create(t_receiver *p_receiver, unsigned p_taskid)
void Start_FromListViewEx(HWND p_listview, unsigned p_item, unsigned p_subitem, unsigned p_linecount, unsigned p_flags, pfc::rcptr_t< pfc::string_base > p_content, completion_notify_ptr p_notify)
bool select_single_item(HWND p_listview, unsigned p_index)
pfc::rcptr_t< pfc::string8 > m_content
Definition: inplace_edit.h:124
void InPlaceEdit::CTableEditHelper::on_task_completion ( unsigned  p_taskid,
unsigned  p_state 
)
inline

Definition at line 79 of file inplace_edit.h.

79  {
80  if (p_taskid == KTaskID) {
81  m_notify.release();
82  if (m_content.is_valid()) {
85  }
87  }
88  /*if (InPlaceEdit::TableEditAdvance(m_item,m_column,m_itemcount,m_columncount,p_state))*/
91  __Start();
92  } else {
94  }
95  }
96  }
virtual void TableEdit_Finished()
Definition: inplace_edit.h:77
service_ptr_t< completion_notify_orphanable > m_notify
Definition: inplace_edit.h:125
virtual bool TableEdit_OnEditCompleted(unsigned item, unsigned column, unsigned state)
Definition: inplace_edit.h:107
virtual void TableEdit_SetItemText(unsigned p_item, unsigned p_column, const char *p_text)
Definition: inplace_edit.h:73
void release()
Definition: service.h:109
void release()
Definition: rcptr.h:86
bool TableEditAdvance_ListView(HWND p_listview, unsigned p_column_base, unsigned &p_item, unsigned &p_column, unsigned p_item_count, unsigned p_column_count, unsigned p_whathappened)
pfc::rcptr_t< pfc::string8 > m_content
Definition: inplace_edit.h:124
bool is_valid() const
Definition: rcptr.h:80
void InPlaceEdit::CTableEditHelper::TableEdit_Abort ( bool  p_forwardcontent)
inline

Definition at line 44 of file inplace_edit.h.

44  {
45  if (m_notify.is_valid()) {
46  m_notify->orphan();
47  m_notify.release();
48 
49  if (p_forwardcontent && (m_flags & KFlagReadOnly) == 0) {
50  if (m_content.is_valid()) {
51  pfc::string8 temp(*m_content);
54  }
55  } else {
57  }
58  SetFocus(NULL);
60  }
61  }
virtual void TableEdit_Finished()
Definition: inplace_edit.h:77
service_ptr_t< completion_notify_orphanable > m_notify
Definition: inplace_edit.h:125
bool is_valid() const
Definition: service.h:119
virtual void TableEdit_SetItemText(unsigned p_item, unsigned p_column, const char *p_text)
Definition: inplace_edit.h:73
void release()
Definition: service.h:109
void release()
Definition: rcptr.h:86
pfc::rcptr_t< pfc::string8 > m_content
Definition: inplace_edit.h:124
bool is_valid() const
Definition: rcptr.h:80
virtual void InPlaceEdit::CTableEditHelper::TableEdit_Finished ( )
inlinevirtual

Definition at line 77 of file inplace_edit.h.

77 {}
virtual bool InPlaceEdit::CTableEditHelper::TableEdit_GetItemText ( unsigned  p_item,
unsigned  p_column,
pfc::string_base p_out,
unsigned &  p_linecount 
)
inlinevirtual

Definition at line 68 of file inplace_edit.h.

68  {
70  p_linecount = pfc::is_multiline(p_out) ? 5 : 1;
71  return true;
72  }
bool is_multiline(const char *p_string, t_size p_len)
void get_item_text(HWND p_listview, unsigned p_index, unsigned p_column, pfc::string_base &p_out)
HWND InPlaceEdit::CTableEditHelper::TableEdit_GetListView ( ) const
inlineprotected

Definition at line 105 of file inplace_edit.h.

bool InPlaceEdit::CTableEditHelper::TableEdit_IsActive ( ) const
inline

Definition at line 64 of file inplace_edit.h.

64  {
65  return m_notify.is_valid();
66  }
service_ptr_t< completion_notify_orphanable > m_notify
Definition: inplace_edit.h:125
bool is_valid() const
Definition: service.h:119
virtual bool InPlaceEdit::CTableEditHelper::TableEdit_OnEditCompleted ( unsigned  item,
unsigned  column,
unsigned  state 
)
inlineprotectedvirtual

Definition at line 107 of file inplace_edit.h.

107 {return true;}
virtual void InPlaceEdit::CTableEditHelper::TableEdit_SetItemText ( unsigned  p_item,
unsigned  p_column,
const char *  p_text 
)
inlinevirtual

Definition at line 73 of file inplace_edit.h.

73  {
74  listview_helper::set_item_text(m_listview,p_item,p_column + m_basecolumn,p_text);
75  }
bool set_item_text(HWND p_listview, unsigned p_index, unsigned p_column, const char *p_name)
void InPlaceEdit::CTableEditHelper::TableEdit_Start ( HWND  p_listview,
unsigned  p_item,
unsigned  p_column,
unsigned  p_itemcount,
unsigned  p_columncount,
unsigned  p_basecolumn,
unsigned  p_flags = 0 
)
inline

Definition at line 32 of file inplace_edit.h.

32  {
33  if (m_notify.is_valid() || p_columncount == 0 || p_itemcount == 0 || p_item >= p_itemcount || p_column >= p_columncount) return;
34  m_listview = p_listview;
35  m_item = p_item;
36  m_column = p_column;
37  m_itemcount = p_itemcount;
38  m_columncount = p_columncount;
39  m_basecolumn = p_basecolumn;
40  m_flags = p_flags;
41  __Start();
42  }
service_ptr_t< completion_notify_orphanable > m_notify
Definition: inplace_edit.h:125
bool is_valid() const
Definition: service.h:119

Field Documentation

unsigned InPlaceEdit::CTableEditHelper::m_basecolumn
private

Definition at line 122 of file inplace_edit.h.

unsigned InPlaceEdit::CTableEditHelper::m_column
private

Definition at line 121 of file inplace_edit.h.

unsigned InPlaceEdit::CTableEditHelper::m_columncount
private

Definition at line 122 of file inplace_edit.h.

pfc::rcptr_t<pfc::string8> InPlaceEdit::CTableEditHelper::m_content
private

Definition at line 124 of file inplace_edit.h.

unsigned InPlaceEdit::CTableEditHelper::m_flags
private

Definition at line 123 of file inplace_edit.h.

unsigned InPlaceEdit::CTableEditHelper::m_item
private

Definition at line 121 of file inplace_edit.h.

unsigned InPlaceEdit::CTableEditHelper::m_itemcount
private

Definition at line 122 of file inplace_edit.h.

HWND InPlaceEdit::CTableEditHelper::m_listview
private

Definition at line 120 of file inplace_edit.h.

service_ptr_t<completion_notify_orphanable> InPlaceEdit::CTableEditHelper::m_notify
private

Definition at line 125 of file inplace_edit.h.


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