46 #include "NCPadWidget.h"
47 #include "NCTablePad.h"
49 #include "NCPkgStrings.h"
55 #include <zypp/ui/Selectable.h>
57 #include "NCPkgStatusStrategy.h"
81 ZyppStatus stat = S_NoInst );
85 void setStatus( ZyppStatus stat ) { status = stat; }
86 ZyppStatus getStatus()
const {
return status; }
88 std::string statusToString( ZyppStatus stat )
const;
90 ZyppObj getDataPointer()
const {
return dataPointer; }
91 ZyppSel getSelPointer()
const {
return selPointer; }
104 std::vector<NCTableLine *>::iterator itemsBegin,
105 std::vector<NCTableLine *>::iterator itemsEnd,
109 if ( _header[ uiColumn ] == NCPkgStrings::PkgSize() )
111 std::sort( itemsBegin, itemsEnd, CompareSize() );
115 std::sort( itemsBegin, itemsEnd, Compare( uiColumn ) );
120 std::vector<std::string> _header;
128 bool operator() ( NCTableLine * first,
132 YTableItem *firstItem =
dynamic_cast<YTableItem*
> (first->origItem() );
133 YTableItem *secondItem =
dynamic_cast<YTableItem*
> (second->origItem() );
137 return firstTag->getDataPointer()->installSize() <
138 secondTag->getDataPointer()->installSize();
150 bool operator() ( NCTableLine * first,
154 std::wstring w1 = first->GetCol( _uiCol )->Label().getText().begin()->str();
155 std::wstring w2 = second->GetCol( _uiCol )->Label().getText().begin()->str();
156 int result = wcscoll ( w1.data(), w2.data() );
178 enum NCPkgTableType {
190 enum NCPkgTableListAction {
199 enum NCPkgTableListType {
205 enum NCPkgTableInfoType {
225 NCPkgTableType tableType;
226 bool haveInstalledVersion;
231 NCPkgTableInfoType visibleInfo;
233 std::vector<std::string> header;
243 NCPkgTable( YWidget * parent, YTableHeader * tableHeader );
256 virtual void addLine( ZyppStatus status,
257 const std::vector<std::string> & elements,
264 void drawList( ) { myPad()->setOrder(1);
return DrawPad(); }
278 virtual void cellChanged(
int index,
int colnum,
const std::string & newtext );
313 const ZyppSel & slbPtr,
317 bool changeObjStatus(
int key );
319 bool changeListObjStatus( NCPkgTableListAction key );
321 bool toggleObjStatus( );
342 bool SourceInstall(
bool install );
357 delete statusStrategy;
358 statusStrategy = strategy;
364 NCPkgTableType getTableType() {
return tableType; }
420 void setVisibleInfo( NCPkgTableInfoType info) { visibleInfo = info; }
422 NCPkgTableInfoType VisibleInfo() {
return visibleInfo ; }
424 bool fillAvailableList ( ZyppSel slb );
425 bool fillSummaryList ( NCPkgTableListType type );
427 void updateInfo( ZyppObj pkgPtr, ZyppSel slbPtr, NCPkgTableInfoType mode );
433 #endif // NCPkgTable_h