YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
ShlTextReader类 参考

文本阅读器 Shell 。 更多...

#include <ShlReader.h>

类 ShlTextReader 继承关系图:
ShlTextReader 的协作图:

class  BaseSession
 
class  BookmarkSession
 
class  SettingSession
 

Public 成员函数

 ShlTextReader (const IO::Path &, const shared_ptr< Desktop > &={}, const shared_ptr< Desktop > &={})
 构造:使用指定路径和上下桌面。
 
 ~ShlTextReader () override
 析构:释放资源。
 
void LoadFile (const IO::Path &)
 读取文件。
 
bool Locate (Bookmark::PositionType)
 定位到文本中的指定位置:更新阅读器状态、阅读列表和按钮状态。
 
void Scroll ()
 当自动滚屏有效状态为 true 时超时自动滚屏。
 
void UpdateButtons ()
 更新按钮状态。
 
- Public 成员函数 继承自 ShlReader
 ShlReader (const IO::Path &, const shared_ptr< Desktop > &={}, const shared_ptr< Desktop > &={})
 构造:使用指定路径和上下桌面。
 
void Exit ()
 退出阅读器:停止后台任务并发送消息准备切换至 ShlExplorer
 
void OnInput () override
 处理输入消息:发送绘制消息,当处于滚屏状态时自动执行滚屏。
 
- Public 成员函数 继承自 ShlDS
 ShlDS (const shared_ptr< Desktop > &={}, const shared_ptr< Desktop > &={})
 构造:使用指定上下桌面。
 
 DefGetter (const ynothrow, const shared_ptr< Desktop > &, DesktopUpHandle, desktop_up_ptr) DefGetter(const ynothrow
 
const shared_ptr< Desktop >
desktop_down_ptr 
DefGetter (const ynothrow, Desktop &, DesktopUp,*desktop_up_ptr) DefGetter(const ynothrow
 
const shared_ptr< Desktop >
desktop_down_ptr Desktop
*desktop_down_ptr void 
OnGotMessage (const Message &) override
 消息处理函数。
 
void OnInput () override
 处理输入消息:发送绘制消息。
 

Public 属性

ReadingListLastRead
 近期浏览记录。
 
ReaderSetting CurrentSetting
 当前阅读器设置。
 

Protected 属性

Timers::Timer tmrScroll
 滚屏计时器。
 
InputTimer tmrInput
 按键计时器。
 
BookmarkPanel pnlBookmark
 书签管理面板。
 
DualScreenReader reader
 
ReaderBox boxReader
 
TextInfoBox boxTextInfo
 
SettingPanel pnlSetting
 设置面板。
 
unique_ptr< TextFilepTextFile
 
MenuHost mhMain
 
- Protected 属性 继承自 ShlReader
IO::Path CurrentPath
 当前路径。
 
std::function< void()> fBackgroundTask
 背景任务:用于滚屏。
 
bool bExit
 退出标识。
 
- Protected 属性 继承自 ShlDS
bool bUpdateUp
 指定当前桌面是否需要更新。
 
bool bUpdateDown
 

Private 成员函数

void Execute (IndexEventArgs::ValueType)
 执行阅读器命令。
 
void ShowMenu (Menu::ID, const Point &)
 
void StopAutoScroll ()
 停止自动滚屏。
 
void Switch (Text::Encoding)
 切换编码。
 
void UpdateReadingList (bool)
 更新近期浏览记录并更新按钮状态。
 
void OnClick (TouchEventArgs &&)
 
void OnKeyDown (KeyEventArgs &&)
 

Private 属性

unique_ptr< BaseSessionsession_ptr
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 ShlReader
static BookmarkList LoadBookmarks (const string &)
 
static ReaderSetting LoadGlobalConfiguration ()
 载入阅读器配置。
 
static void SaveBookmarks (const string &, const BookmarkList &)
 
static void SaveGlobalConfiguration (const ReaderSetting &)
 保存阅读器配置。
 

详细描述

文本阅读器 Shell 。

自从
build 296

在文件 ShlReader.h217 行定义.

构造及析构函数说明

ShlTextReader::ShlTextReader ( const IO::Path pth,
const shared_ptr< Desktop > &  h_dsk_up = {},
const shared_ptr< Desktop > &  h_dsk_dn = {} 
)

构造:使用指定路径和上下桌面。

参见
ShlDS::ShlDS
自从
build 395

在文件 ShlReader.cpp341 行定义.

ShlTextReader::~ShlTextReader ( )
override

成员函数说明

void ShlTextReader::Execute ( IndexEventArgs::ValueType  idx)
private
void ShlTextReader::LoadFile ( const IO::Path pth)

读取文件。

注解
不刷新按钮状态。
自从
build 286

在文件 ShlReader.cpp524 行定义.

参考 BookmarkPanel::bookmarks,ShlReader::CurrentPath,ystdex::erase_all_if(),YSLib::IO::Path::GetNativeString(),DualScreenReader::LoadText(),CHRLib::CharSet::Null,pnlBookmark,pTextFile , 以及 reader.

参考自 UpdateReadingList().

函数调用图:

这是这个函数的调用关系图:

bool ShlTextReader::Locate ( Bookmark::PositionType  pos)

定位到文本中的指定位置:更新阅读器状态、阅读列表和按钮状态。

返回
是否成功:在有效范围内且和原位置不同。
自从
build 394

在文件 ShlReader.cpp539 行定义.

参考 ShlReader::CurrentPath,ReadingList::Insert(),LastRead,DualScreenReader::Locate(),reader,UpdateButtons() , 以及 YB_LIKELY.

函数调用图:

void ShlTextReader::OnClick ( TouchEventArgs &&  )
private

在文件 ShlReader.cpp639 行定义.

参考 Close(),Deactivate(),YSLib::UI::IsVisible() , 以及 Show().

函数调用图:

void ShlTextReader::Scroll ( )

当自动滚屏有效状态为 true 时超时自动滚屏。

自从
build 289

在文件 ShlReader.cpp560 行定义.

参考 DualScreenReader::Execute(),YSLib::Timers::Timer::IsActive(),DualScreenReader::LineDownScroll,reader,YSLib::Timers::Timer::Refresh(),DualScreenReader::ScrollByPixel(),tmrScroll , 以及 YB_UNLIKELY.

参考自 OnKeyDown().

函数调用图:

这是这个函数的调用关系图:

void ShlTextReader::ShowMenu ( Menu::ID  id,
const Point &  pt 
)
private

在文件 ShlReader.cpp573 行定义.

参考 mhMain,reader , 以及 SetLocationOf().

函数调用图:

void ShlTextReader::StopAutoScroll ( )
private

停止自动滚屏。

自从
build 297

在文件 ShlReader.cpp594 行定义.

参考 DualScreenReader::AdjustScrollOffset(),Deactivate(),ShlReader::fBackgroundTask,reader , 以及 tmrScroll.

参考自 ShlTextReader::BaseSession::BaseSession() , 以及 OnKeyDown().

函数调用图:

这是这个函数的调用关系图:

void ShlTextReader::Switch ( Text::Encoding  )
private

切换编码。

注解
若文本文件无效、参数为 Encoding() 或与当前编码相同则忽略。
自从
build 292

在文件 ShlReader.cpp602 行定义.

参考 DualScreenReader::LoadText(),pTextFile , 以及 reader.

函数调用图:

void ShlTextReader::UpdateButtons ( )

更新按钮状态。

注解
检查近期浏览记录状态确定可用性。
自从
build 286

在文件 ShlReader.cpp627 行定义.

参考 boxReader,ReaderBox::btnNext,ReaderBox::btnPrev,ReadingList::CheckBoundary(),Enable(),LastRead , 以及 yunseq().

参考自 Locate() , 以及 UpdateReadingList().

函数调用图:

这是这个函数的调用关系图:

void ShlTextReader::UpdateReadingList ( bool  is_prev)
private

更新近期浏览记录并更新按钮状态。

参数
是否后退。
自从
build 286

在文件 ShlReader.cpp613 行定义.

参考 ShlReader::CurrentPath,ReadingList::Insert(),LastRead,LoadFile(),DualScreenReader::Locate(),reader,ReadingList::Switch() , 以及 UpdateButtons().

函数调用图:

类成员变量说明

ReaderBox ShlTextReader::boxReader
protected

在文件 ShlReader.h268 行定义.

参考自 ShlTextReader::BaseSession::BaseSession() , 以及 UpdateButtons().

TextInfoBox ShlTextReader::boxTextInfo
protected

在文件 ShlReader.h269 行定义.

参考自 ShlTextReader::BaseSession::BaseSession() , 以及 Execute().

ReaderSetting ShlTextReader::CurrentSetting

当前阅读器设置。

自从
build 334

在文件 ShlReader.h251 行定义.

参考自 ShlTextReader::SettingSession::SettingSession().

ReadingList& ShlTextReader::LastRead

近期浏览记录。

自从
build 296

在文件 ShlReader.h246 行定义.

参考自 Locate(),UpdateButtons(),UpdateReadingList() , 以及 ~ShlTextReader().

MenuHost ShlTextReader::mhMain
protected

在文件 ShlReader.h273 行定义.

参考自 OnKeyDown() , 以及 ShowMenu().

BookmarkPanel ShlTextReader::pnlBookmark
protected

书签管理面板。

自从
build 391

在文件 ShlReader.h279 行定义.

参考自 ShlTextReader::BookmarkSession::BookmarkSession(),LoadFile() , 以及 ~ShlTextReader().

SettingPanel ShlTextReader::pnlSetting
protected

设置面板。

在文件 ShlReader.h271 行定义.

参考自 ShlTextReader::SettingSession::SettingSession().

unique_ptr<TextFile> ShlTextReader::pTextFile
protected

在文件 ShlReader.h272 行定义.

参考自 LoadFile() , 以及 Switch().

unique_ptr<BaseSession> ShlTextReader::session_ptr
private
自从
build 391

在文件 ShlReader.h283 行定义.

参考自 Execute().

InputTimer ShlTextReader::tmrInput
protected

按键计时器。

注解
独立计时,排除路由事件干扰。
自从
build 300

在文件 ShlReader.h264 行定义.

参考自 OnKeyDown().

Timers::Timer ShlTextReader::tmrScroll
protected

滚屏计时器。

自从
build 289

在文件 ShlReader.h258 行定义.

参考自 OnKeyDown(),Scroll() , 以及 StopAutoScroll().


该类的文档由以下文件生成: