#include "GuiListViewControls.h"
#include "GuiListViewItemTemplates.h"
#include "../Templates/GuiThemeStyleFactory.h"
#include "../../GraphicsComposition/GuiGraphicsStackComposition.h"
namespace
{
namespace
{
namespace
{
using
namespace
elements
;
using
namespace
compositions
;
using
namespace
collections
;
using
namespace
reflection
::
description
;
void
::
BeforeControlTemplateUninstalled_
()
{
}
void
::
AfterControlTemplateInstalled_
(
bool
)
{
TypedControlTemplateObject
(
true
)->
(
);
}
::
(
theme
::
)
:
(
)
{
}
::
()
{
}
bool
::
()
{
return
false
;
}
::
()
{
return
;
}
void
::
(
)
{
if
(
!=
)
{
=
;
TypedControlTemplateObject
(
true
)->
(
);
}
}
void
::
BeforeControlTemplateUninstalled_
()
{
}
void
::
AfterControlTemplateInstalled_
(
bool
)
{
}
::
(
theme
::
,
::
*
)
:
(
,
)
{
.
(
);
}
::
()
{
}
namespace
{
const
wchar_t
*
const
::
=
L"vl::presentation::controls::list::IListViewItemView"
;
ListViewColumnItemArranger
::
::
(
ListViewColumnItemArranger
*
)
:arranger(
)
{
}
ListViewColumnItemArranger
::
::
()
{
}
void
ListViewColumnItemArranger
::
::
()
{
->
();
FOREACH(ItemStyleRecord, style, arranger->visibleStyles)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
style
);)
{
if
(
auto
=
dynamic_cast
<
*>(
style
.
))
{
callback
->
();
}
}
}
const
wchar_t
*
const
ListViewColumnItemArranger
::
::
=
L"vl::presentation::controls::list::ListViewColumnItemArranger::IColumnItemView"
;
void
ListViewColumnItemArranger
::
(
,
compositions
::
*
,
compositions
::
&
)
{
(
->
.
());
args
.
=
;
->
.
(
args
);
}
void
ListViewColumnItemArranger
::
(
,
compositions
::
*
,
compositions
::
&
)
{
*
=
]->
();
=
buttonBounds
->
().
();
if
(
size
>
->
(
))
{
->
(
,
size
);
}
}
void
ListViewColumnItemArranger
::
(
compositions
::
*
,
compositions
::
&
)
{
if
(
->
())
{
.
=
true
;
=
true
;
=
.
;
}
}
void
ListViewColumnItemArranger
::
(
compositions
::
*
,
compositions
::
&
)
{
if
(
->
())
{
.
=
true
;
=
false
;
=
0
;
}
}
void
ListViewColumnItemArranger
::
ColumnHeaderSplitterMouseMove
(
compositions
::
*
,
compositions
::
&
)
{
if
(
)
{
=
.
-
;
=
.
(
dynamic_cast
<
*>(
));
if
(
index
!=-
1
)
{
*
=
index
]->
();
=
buttonBounds
->
();
(
bounds
.
(),
(
bounds
.
()+
offset
,
bounds
.
()));
buttonBounds
->
(
newBounds
);
=
buttonBounds
->
().
();
->
(
index
,
finalSize
);
}
}
}
void
ListViewColumnItemArranger
::
()
{
::
();
=
->
()->
().
();
->
()->
(
,
count
-
1
);
->
(
(
(-
.
(),
0
),
(
0
,
0
)));
}
ListViewColumnItemArranger
::
()
{
=
->
().
()-
;
if
(
width
<
)
{
width
=
;
}
return
width
;
}
ListViewColumnItemArranger
::
()
{
return
->
().
();
}
ListViewColumnItemArranger
::
()
{
=
::
();
size
.
+=
;
return
size
;
}
void
ListViewColumnItemArranger
::
()
{
for
(
=
->
().
()-
1
;
i
>=
0
;
i
--)
{
*
=
->
().
(
i
);
->
(
item
);
*
=
item
->
().
(
0
)->
();
if
(
button
)
{
item
->
(
button
->
());
delete
button
;
}
delete
item
;
}
.
();
.
();
}
void
ListViewColumnItemArranger
::
()
{
if
(
&&
.
() ==
->
())
{
for
(
=
0
;
i
<
->
();
i
++)
{
*
=
i
];
button
->
(
->
(
i
));
button
->
(
->
(
i
),
false
);
button
->
(
->
(
i
));
button
->
()->
(
(
(
0
,
0
),
(
->
(
i
),
0
)));
}
}
else
{
();
if
(
&&
)
{
for
(
=
0
;
i
<
->
();
i
++)
{
*
=
new
;
splitterComposition
->
(
(
0
,
0
,
0
,
0
));
splitterComposition
->
(
()->
()->
(
::
));
splitterComposition
->
(
(
0
,
0
, -
1
,
0
));
splitterComposition
->
(
(
,
0
));
.
(
splitterComposition
);
splitterComposition
->
()->
.
(
this
, &
ListViewColumnItemArranger
::
ColumnHeaderSplitterLeftButtonDown
);
splitterComposition
->
()->
.
(
this
, &
ListViewColumnItemArranger
::
ColumnHeaderSplitterLeftButtonUp
);
splitterComposition
->
()->
.
(
this
, &
ListViewColumnItemArranger
::
ColumnHeaderSplitterMouseMove
);
}
for
(
=
0
;
i
<
->
();
i
++)
{
*
=
new
(
theme
::
::
);
button
->
(
false
);
button
->
(
->
TypedControlTemplateObject
(
true
)->
());
button
->
(
->
(
i
));
button
->
(
->
(
i
),
false
);
button
->
(
->
(
i
));
button
->
()->
(
(
(
0
,
0
),
(
->
(
i
),
0
)));
button
->
.
(
(
<
void
(
,
*,
&)>(
this
, &
ListViewColumnItemArranger
::
))
i
));
button
->
()->
.
(
(
<
void
(
,
*,
&)>(
this
, &
ListViewColumnItemArranger
::
))
i
));
.
(
button
);
if
(
i
>
0
)
{
button
->
()->
(
i
-
1
]);
}
*
=
new
;
item
->
(
::
LimitToElementAndChildren
);
item
->
(
button
->
());
->
(
item
);
}
if
(
->
() >
0
)
{
*
=
->
() -
1
];
*
=
new
;
item
->
(
::
LimitToElementAndChildren
);
item
->
(
splitterComposition
);
->
(
item
);
}
}
}
->
();
}
ListViewColumnItemArranger
::
ListViewColumnItemArranger
()
{
=
new
;
->
(
::
LimitToElementAndChildren
);
new
(
this
);
}
ListViewColumnItemArranger
::
~
ListViewColumnItemArranger
()
{
if
(!
->
())
{
();
delete
;
}
}
void
ListViewColumnItemArranger
::
(
*
)
{
::
(
);
=
dynamic_cast
<
*>(
);
if
(
)
{
=
dynamic_cast
<
*>(
->
()->
(
::
));
=
dynamic_cast
<
*>(
->
()->
(
::
));
->
()->
(
);
if
(
)
{
->
(
.
());
();
}
}
}
void
ListViewColumnItemArranger
::
()
{
if
(
)
{
if
(
)
{
->
(
.
());
=
nullptr
;
}
=
nullptr
;
->
()->
(
);
=
nullptr
;
}
::
();
}
void
::
(
,
,
)
{
->
();
}
void
::
()
{
if
(
)
{
=
->
(
this
);
->
(
index
,
1
,
1
);
}
}
::
()
:owner(
0
)
{
.
=
this
;
}
&
::
()
{
return
;
}
<
>
::
()
{
return
;
}
void
::
(
<
>
)
{
;
();
}
<
>
::
()
{
return
;
}
void
::
(
<
>
)
{
;
();
}
const
&
::
()
{
return
;
}
void
::
(
const
&
)
{
;
();
}
description
::
::
()
{
return
;
}
void
::
(
const
description
::
&
)
{
;
();
}
void
::
(
bool
)
{
if
(
)
{
=
->
(
this
);
->
(
index
,
);
}
}
::
(
const
&
,
)
:text(
)
,size(
)
{
}
::
()
{
if
(
&&
)
{
(
);
}
}
const
&
::
()
{
return
;
}
void
::
(
const
&
)
{
if
(
!=
)
{
;
(
false
);
}
}
<
>
::
()
{
return
;
}
void
::
(
const
<
>&
)
{
;
(
true
);
}
::
()
{
return
;
}
void
::
(
)
{
if
(
!=
)
{
=
;
(
false
);
}
}
bool
::
()
{
return
;
}
void
::
(
bool
)
{
=
;
}
*
::
()
{
return
;
}
void
::
(
*
)
{
if
(
!=
)
{
=
;
(
false
);
}
}
::
()
{
return
;
}
void
::
(
)
{
if
(
!=
)
{
=
;
(
false
);
}
}
void
::
(
,
,
)
{
->
();
}
::
(
*
)
:itemProvider(
)
{
}
::
()
{
}
void
::
(
,
bool
)
{
=
;
(
,
1
);
=
true
;
}
void
::
(
,
const
<
>&
)
{
collections
::
<
<
>>::
(
,
);
=
this
;
}
void
::
(
,
const
<
>&
)
{
=
0
;
collections
::
<
<
>>::
(
,
);
}
void
::
(
,
,
)
{
->
();
if
(
)
{
->
();
}
}
::
(
*
)
:itemProvider(
)
{
}
::
()
{
}
void
::
(
,
const
<
>&
)
{
<
<
>>::
(
,
);
=
this
;
}
void
::
(
,
const
<
>&
)
{
=
0
;
<
<
>>::
(
,
);
}
void
::
()
{
(
0
,
());
}
void
::
()
{
for
(
=
0
;
i
<
.
();
i
++)
{
i
]->
();
}
}
<
>
::
(
)
{
return
(
)
;
}
<
>
::
(
)
{
return
(
)
;
}
::
(
)
{
return
(
)
text
;
}
::
(
,
)
{
<
>
=
(
);
if
(
<
0
||
>=
item
().
())
{
return
L""
;
}
else
{
return
item
()
];
}
}
::
()
{
return
.
();
}
::
(
)
{
return
];
}
::
()
{
return
.
();
}
::
(
)
{
if
(
<
0
||
>=
.
())
{
return
L""
;
}
else
{
return
]
();
}
}
bool
::
(
ListViewColumnItemArranger
::
*
)
{
if
(
.
(
))
{
return
false
;
}
else
{
.
(
);
return
true
;
}
}
bool
::
(
ListViewColumnItemArranger
::
*
)
{
=
.
(
);
if
(
index
==-
1
)
{
return
false
;
}
else
{
.
(
);
return
true
;
}
}
::
(
)
{
if
(
<
0
||
>=
.
())
{
return
0
;
}
else
{
return
]
();
}
}
void
::
(
,
)
{
if
(
>=
0
&&
<
.
())
{
]
(
);
}
}
*
::(
)
{
if
(
<
0
||
>=
.
())
{
return
0
;
}
else
{
return
]
();
}
}
::
(
)
{
if
(
<
0
||
>=
.
())
{
return
::
;
}
else
{
return
]
();
}
}
::
(
)
{
return
(
);
}
description
::
::
(
)
{
return
::
(
(
));
}
::
()
:columns(
this
)
, dataColumns(
this
)
{
}
::
()
{
}
*
::
(
const
&
)
{
if
(
==
::
)
{
return
(
*)
this
;
}
else
if
(
==
ListViewColumnItemArranger
::
::
)
{
return
(
ListViewColumnItemArranger
::
*)
this
;
}
else
{
return
0
;
}
}
&
::
()
{
return
;
}
&
::
()
{
return
;
}
}
void
::
(
,
*
)
{
::
(
,
);
}
void
::
(
compositions
::
*
,
compositions
::
&
)
{
=
::
;
}
::
(
theme
::
,
::
*
)
:
(
,
)
{
(
::
);
}
::
()
{
}
::
()
{
return
;
}
void
::
(
)
{
switch
(
)
{
case
::
:
(
[](
const
&) {
return
new
list
::
BigIconListViewItemTemplate
; },
new
list
::
FixedSizeMultiColumnItemArranger
);
break
;
case
::
:
(
[](
const
&) {
return
new
list
::
SmallIconListViewItemTemplate
; },
new
list
::
FixedSizeMultiColumnItemArranger
);
break
;
case
::
:
(
[](
const
&) {
return
new
list
::
; },
new
list
::
FixedHeightMultiColumnItemArranger
);
break
;
case
::
:
(
[](
const
&) {
return
new
list
::
; },
new
list
::
FixedSizeMultiColumnItemArranger
);
break
;
case
::
:
(
[](
const
&) {
return
new
list
::
InformationListViewItemTemplate
; },
new
list
::
);
break
;
case
::
:
(
[](
const
&) {
return
new
list
::
DetailListViewItemTemplate
; },
new
list
::
ListViewColumnItemArranger
);
break
;
default
:;
}
=
;
}
::
(
theme
::
)
:
(
,
new
list
::
)
{
=
dynamic_cast
<
list
::
*>(
.
());
}
::
()
{
}
list
::
&
::
()
{
return
*
;
}
list
::
&
::
()
{
return
->
();
}
list
::
&
::
()
{
return
->
();
}
<
list
::
>
::
()
{
=
();
if
(
index
== -
1
)
return
0
;
return
->
(
index
);
}
}
}
}