[PowerRename] Add Filtering Feature (#6017)

* Implement basic functionality

* Change approach.
move filter controls to manager
edit redrawing to always work with new GetVisibleItemCount() and GetVisibleItemByIndex() calls

* Fix performance issues. Some refactoring.

* Handle toggleAll correctly

* Handle dangling elements when filter is on

Make an item visible if it has at least one visible subitem

* Support filtering for selected and shouldRename

* Refactor for readability, remove useless member from PowerRenameUI

* Change variable names in PowerRenameUI for clarity

Use wrapper function RedrawItems() and SetItemCount() for consistency

* Handle result value properly in getVisibleItemByIndex()

* Add FlagsApplicable filter

* Add visual indication of filters

* Improve performance

Check if no filter is selected
Call SetItemCount() only when necessary

* Refactor for readability

* Get lock in setVisible()

* Change function names to camel case

* Change function names to start with uppercase

* Change filter behaviour when search area is empty

Show all elements when search area is empty and ShouldRename filter is selected
Avoid warnings

* Resolve conflicts
This commit is contained in:
Mehmet Murat Akburak
2020-08-25 08:22:05 +03:00
committed by GitHub
parent 3ede1a0b53
commit d3b80b26e3
14 changed files with 460 additions and 199 deletions

View File

@@ -14,22 +14,23 @@ public:
IFACEMETHODIMP_(ULONG) Release();
// IPowerRenameItem
IFACEMETHODIMP get_path(_Outptr_ PWSTR* path);
IFACEMETHODIMP get_date(_Outptr_ SYSTEMTIME* date);
IFACEMETHODIMP get_shellItem(_Outptr_ IShellItem** ppsi);
IFACEMETHODIMP get_originalName(_Outptr_ PWSTR* originalName);
IFACEMETHODIMP put_newName(_In_opt_ PCWSTR newName);
IFACEMETHODIMP get_newName(_Outptr_ PWSTR* newName);
IFACEMETHODIMP get_isFolder(_Out_ bool* isFolder);
IFACEMETHODIMP get_isSubFolderContent(_Out_ bool* isSubFolderContent);
IFACEMETHODIMP get_selected(_Out_ bool* selected);
IFACEMETHODIMP put_selected(_In_ bool selected);
IFACEMETHODIMP get_id(_Out_ int* id);
IFACEMETHODIMP get_iconIndex(_Out_ int* iconIndex);
IFACEMETHODIMP get_depth(_Out_ UINT* depth);
IFACEMETHODIMP put_depth(_In_ int depth);
IFACEMETHODIMP GetPath(_Outptr_ PWSTR* path);
IFACEMETHODIMP GetDate(_Outptr_ SYSTEMTIME* date);
IFACEMETHODIMP GetShellItem(_Outptr_ IShellItem** ppsi);
IFACEMETHODIMP GetOriginalName(_Outptr_ PWSTR* originalName);
IFACEMETHODIMP PutNewName(_In_opt_ PCWSTR newName);
IFACEMETHODIMP GetNewName(_Outptr_ PWSTR* newName);
IFACEMETHODIMP GetIsFolder(_Out_ bool* isFolder);
IFACEMETHODIMP GetIsSubFolderContent(_Out_ bool* isSubFolderContent);
IFACEMETHODIMP GetSelected(_Out_ bool* selected);
IFACEMETHODIMP PutSelected(_In_ bool selected);
IFACEMETHODIMP GetId(_Out_ int* id);
IFACEMETHODIMP GetIconIndex(_Out_ int* iconIndex);
IFACEMETHODIMP GetDepth(_Out_ UINT* depth);
IFACEMETHODIMP PutDepth(_In_ int depth);
IFACEMETHODIMP Reset();
IFACEMETHODIMP ShouldRenameItem(_In_ DWORD flags, _Out_ bool* shouldRename);
IFACEMETHODIMP IsItemVisible(_In_ DWORD filter, _In_ DWORD flags, _Out_ bool* isItemVisible);
// IPowerRenameItemFactory
IFACEMETHODIMP Create(_In_ IShellItem* psi, _Outptr_ IPowerRenameItem** ppItem)