#include "xfa/fwl/cfwl_monthcalendar.h"
#include <algorithm>
#include <memory>
#include <utility>
#include "core/fxcrt/cfx_datetime.h"
#include "core/fxcrt/check.h"
#include "core/fxcrt/containers/contains.h"
#include "core/fxcrt/notreached.h"
#include "core/fxcrt/stl_util.h"
#include "xfa/fde/cfde_textout.h"
#include "xfa/fwl/cfwl_datetimepicker.h"
#include "xfa/fwl/cfwl_messagemouse.h"
#include "xfa/fwl/cfwl_notedriver.h"
#include "xfa/fwl/cfwl_themebackground.h"
#include "xfa/fwl/cfwl_themetext.h"
#include "xfa/fwl/ifwl_themeprovider.h"
namespace pdfium {
namespace {
constexpr float kMonthCalHSepHeight = …;
constexpr float kMonthCalHMargin = …;
constexpr float kMonthCalVMargin = …;
constexpr float kMonthCalRows = …;
constexpr float kMonthCalColumns = …;
constexpr float kMonthCalHeaderBtnVMargin = …;
constexpr float kMonthCalHeaderBtnHMargin = …;
WideString GetAbbreviatedDayOfWeek(int day) { … }
WideString GetMonth(int month) { … }
}
CFWL_MonthCalendar::CFWL_MonthCalendar(CFWL_App* app,
const Properties& properties,
CFWL_Widget* pOuter)
: … { … }
CFWL_MonthCalendar::~CFWL_MonthCalendar() = default;
FWL_Type CFWL_MonthCalendar::GetClassID() const { … }
CFX_RectF CFWL_MonthCalendar::GetAutosizedWidgetRect() { … }
void CFWL_MonthCalendar::Update() { … }
void CFWL_MonthCalendar::DrawWidget(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& matrix) { … }
void CFWL_MonthCalendar::SetSelect(int32_t iYear,
int32_t iMonth,
int32_t iDay) { … }
void CFWL_MonthCalendar::DrawBackground(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
void CFWL_MonthCalendar::DrawHeadBK(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
void CFWL_MonthCalendar::DrawLButton(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
void CFWL_MonthCalendar::DrawRButton(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
void CFWL_MonthCalendar::DrawCaption(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
void CFWL_MonthCalendar::DrawSeparator(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
void CFWL_MonthCalendar::DrawDatesInBK(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
void CFWL_MonthCalendar::DrawWeek(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
void CFWL_MonthCalendar::DrawToday(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
void CFWL_MonthCalendar::DrawDatesIn(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
void CFWL_MonthCalendar::DrawDatesOut(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
void CFWL_MonthCalendar::DrawDatesInCircle(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& mtMatrix) { … }
CFX_SizeF CFWL_MonthCalendar::CalcSize() { … }
void CFWL_MonthCalendar::CalcHeadSize() { … }
void CFWL_MonthCalendar::CalcTodaySize() { … }
void CFWL_MonthCalendar::Layout() { … }
void CFWL_MonthCalendar::CalDateItem() { … }
void CFWL_MonthCalendar::InitDate() { … }
void CFWL_MonthCalendar::ClearDateItem() { … }
void CFWL_MonthCalendar::ResetDateItem() { … }
void CFWL_MonthCalendar::NextMonth() { … }
void CFWL_MonthCalendar::PrevMonth() { … }
void CFWL_MonthCalendar::ChangeToMonth(int32_t iYear, int32_t iMonth) { … }
void CFWL_MonthCalendar::RemoveSelDay() { … }
void CFWL_MonthCalendar::AddSelDay(int32_t iDay) { … }
void CFWL_MonthCalendar::JumpToToday() { … }
WideString CFWL_MonthCalendar::GetHeadText(int32_t iYear, int32_t iMonth) { … }
WideString CFWL_MonthCalendar::GetTodayText(int32_t iYear,
int32_t iMonth,
int32_t iDay) { … }
int32_t CFWL_MonthCalendar::GetDayAtPoint(const CFX_PointF& point) const { … }
CFX_RectF CFWL_MonthCalendar::GetDayRect(int32_t iDay) { … }
void CFWL_MonthCalendar::OnProcessMessage(CFWL_Message* pMessage) { … }
void CFWL_MonthCalendar::OnDrawWidget(CFGAS_GEGraphics* pGraphics,
const CFX_Matrix& matrix) { … }
void CFWL_MonthCalendar::OnLButtonDown(CFWL_MessageMouse* pMsg) { … }
void CFWL_MonthCalendar::OnLButtonUp(CFWL_MessageMouse* pMsg) { … }
void CFWL_MonthCalendar::OnMouseMove(CFWL_MessageMouse* pMsg) { … }
void CFWL_MonthCalendar::OnMouseLeave(CFWL_MessageMouse* pMsg) { … }
CFWL_MonthCalendar::DATEINFO::DATEINFO(int32_t day,
int32_t dayofweek,
bool bFlag,
bool bSelect,
const WideString& wsday)
: … { … }
CFWL_MonthCalendar::DATEINFO::~DATEINFO() = default;
Mask<CFWL_PartState> CFWL_MonthCalendar::DATEINFO::AsPartStateMask() const { … }
}