10fbfc30aSopenharmony_ci/** 20fbfc30aSopenharmony_ci * @file Describe the file 30fbfc30aSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 40fbfc30aSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 50fbfc30aSopenharmony_ci * you may not use this file except in compliance with the License. 60fbfc30aSopenharmony_ci * You may obtain a copy of the License at 70fbfc30aSopenharmony_ci * 80fbfc30aSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 90fbfc30aSopenharmony_ci * 100fbfc30aSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 110fbfc30aSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 120fbfc30aSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 130fbfc30aSopenharmony_ci * See the License for the specific language governing permissions and 140fbfc30aSopenharmony_ci * limitations under the License. 150fbfc30aSopenharmony_ci */ 160fbfc30aSopenharmony_ci 170fbfc30aSopenharmony_ciimport data_rdb from '@ohos.data.relationalStore'; 180fbfc30aSopenharmony_ciimport { CalendarsColumns } from './CalendarsColumns'; 190fbfc30aSopenharmony_ci 200fbfc30aSopenharmony_ciinterface CalendarIndexesType { 210fbfc30aSopenharmony_ci idIndex: number; 220fbfc30aSopenharmony_ci accountNameIndex: number; 230fbfc30aSopenharmony_ci accountTypeIndex: number; 240fbfc30aSopenharmony_ci syncIdIndex: number; 250fbfc30aSopenharmony_ci dirtyIndex: number; 260fbfc30aSopenharmony_ci mutatorsIndex: number; 270fbfc30aSopenharmony_ci nameIndex: number; 280fbfc30aSopenharmony_ci calendarDisplayNameIndex: number; 290fbfc30aSopenharmony_ci calendarColorIndex: number; 300fbfc30aSopenharmony_ci calendarColorIndexIndex: number; 310fbfc30aSopenharmony_ci calendarAccessLevelIndex: number; 320fbfc30aSopenharmony_ci visibleIndex: number; 330fbfc30aSopenharmony_ci syncEventsIndex: number; 340fbfc30aSopenharmony_ci calendarLocationIndex: number; 350fbfc30aSopenharmony_ci calendarTimezoneIndex: number; 360fbfc30aSopenharmony_ci ownerAccountIndex: number; 370fbfc30aSopenharmony_ci isPrimaryIndex: number; 380fbfc30aSopenharmony_ci canOrganizerRespondIndex: number; 390fbfc30aSopenharmony_ci canModifyTimeZoneIndex: number; 400fbfc30aSopenharmony_ci canPartiallyUpdateIndex: number; 410fbfc30aSopenharmony_ci maxRemindersIndex: number; 420fbfc30aSopenharmony_ci allowedRemindersIndex: number; 430fbfc30aSopenharmony_ci allowedAvailabilityIndex: number; 440fbfc30aSopenharmony_ci allowedAttendeeTypesIndex: number; 450fbfc30aSopenharmony_ci deletedIndex: number; 460fbfc30aSopenharmony_ci calendarTimeStampIndex: number; 470fbfc30aSopenharmony_ci calSync1Index: number; 480fbfc30aSopenharmony_ci calSync2Index: number; 490fbfc30aSopenharmony_ci calSync3Index: number; 500fbfc30aSopenharmony_ci calSync4Index: number; 510fbfc30aSopenharmony_ci calSync5Index: number; 520fbfc30aSopenharmony_ci calSync6Index: number; 530fbfc30aSopenharmony_ci calSync7Index: number; 540fbfc30aSopenharmony_ci calSync8Index: number; 550fbfc30aSopenharmony_ci calSync9Index: number; 560fbfc30aSopenharmony_ci calSync10Index: number; 570fbfc30aSopenharmony_ci canReminderIndex: number; 580fbfc30aSopenharmony_ci creatorIndex: number; 590fbfc30aSopenharmony_ci} 600fbfc30aSopenharmony_ci 610fbfc30aSopenharmony_ci/** 620fbfc30aSopenharmony_ci * the columns indexes for table Calendars 630fbfc30aSopenharmony_ci * 640fbfc30aSopenharmony_ci * @since 2022-10-18 650fbfc30aSopenharmony_ci */ 660fbfc30aSopenharmony_ciexport class CalendarsIndexes implements CalendarIndexesType { 670fbfc30aSopenharmony_ci idIndex = 0; 680fbfc30aSopenharmony_ci accountNameIndex = 0; 690fbfc30aSopenharmony_ci accountTypeIndex = 0; 700fbfc30aSopenharmony_ci syncIdIndex = 0; 710fbfc30aSopenharmony_ci dirtyIndex = 0; 720fbfc30aSopenharmony_ci mutatorsIndex = 0; 730fbfc30aSopenharmony_ci nameIndex = 0; 740fbfc30aSopenharmony_ci calendarDisplayNameIndex = 0; 750fbfc30aSopenharmony_ci calendarColorIndex = 0; 760fbfc30aSopenharmony_ci calendarColorIndexIndex = 0; 770fbfc30aSopenharmony_ci calendarAccessLevelIndex = 0; 780fbfc30aSopenharmony_ci visibleIndex = 0; 790fbfc30aSopenharmony_ci syncEventsIndex = 0; 800fbfc30aSopenharmony_ci calendarLocationIndex = 0; 810fbfc30aSopenharmony_ci calendarTimezoneIndex = 0; 820fbfc30aSopenharmony_ci ownerAccountIndex = 0; 830fbfc30aSopenharmony_ci isPrimaryIndex = 0; 840fbfc30aSopenharmony_ci canOrganizerRespondIndex = 0; 850fbfc30aSopenharmony_ci canModifyTimeZoneIndex = 0; 860fbfc30aSopenharmony_ci canPartiallyUpdateIndex = 0; 870fbfc30aSopenharmony_ci maxRemindersIndex = 0; 880fbfc30aSopenharmony_ci allowedRemindersIndex = 0; 890fbfc30aSopenharmony_ci allowedAvailabilityIndex = 0; 900fbfc30aSopenharmony_ci allowedAttendeeTypesIndex = 0; 910fbfc30aSopenharmony_ci deletedIndex = 0; 920fbfc30aSopenharmony_ci calendarTimeStampIndex = 0; 930fbfc30aSopenharmony_ci calSync1Index = 0; 940fbfc30aSopenharmony_ci calSync2Index = 0; 950fbfc30aSopenharmony_ci calSync3Index = 0; 960fbfc30aSopenharmony_ci calSync4Index = 0; 970fbfc30aSopenharmony_ci calSync5Index = 0; 980fbfc30aSopenharmony_ci calSync6Index = 0; 990fbfc30aSopenharmony_ci calSync7Index = 0; 1000fbfc30aSopenharmony_ci calSync8Index = 0; 1010fbfc30aSopenharmony_ci calSync9Index = 0; 1020fbfc30aSopenharmony_ci calSync10Index = 0; 1030fbfc30aSopenharmony_ci canReminderIndex = 0; 1040fbfc30aSopenharmony_ci creatorIndex = 0; 1050fbfc30aSopenharmony_ci} 1060fbfc30aSopenharmony_ci 1070fbfc30aSopenharmony_ci/** 1080fbfc30aSopenharmony_ci * parse all indexes for table Calendars 1090fbfc30aSopenharmony_ci * 1100fbfc30aSopenharmony_ci * @param resultSet the result from somewhere rdb.query 1110fbfc30aSopenharmony_ci */ 1120fbfc30aSopenharmony_ciexport function parseCalendarsIndexes(resultSet: data_rdb.ResultSet): CalendarsIndexes | undefined { 1130fbfc30aSopenharmony_ci if (resultSet === null || resultSet === undefined) { 1140fbfc30aSopenharmony_ci return undefined; 1150fbfc30aSopenharmony_ci } 1160fbfc30aSopenharmony_ci let indexes: CalendarsIndexes = new CalendarsIndexes(); 1170fbfc30aSopenharmony_ci indexes.idIndex = resultSet.getColumnIndex(CalendarsColumns.ID); 1180fbfc30aSopenharmony_ci indexes.accountNameIndex = resultSet.getColumnIndex(CalendarsColumns.ACCOUNT_NAME); 1190fbfc30aSopenharmony_ci indexes.accountTypeIndex = resultSet.getColumnIndex(CalendarsColumns.ACCOUNT_TYPE); 1200fbfc30aSopenharmony_ci indexes.syncIdIndex = resultSet.getColumnIndex(CalendarsColumns.SYNC_ID); 1210fbfc30aSopenharmony_ci indexes.dirtyIndex = resultSet.getColumnIndex(CalendarsColumns.DIRTY); 1220fbfc30aSopenharmony_ci indexes.mutatorsIndex = resultSet.getColumnIndex(CalendarsColumns.MUTATORS); 1230fbfc30aSopenharmony_ci indexes.nameIndex = resultSet.getColumnIndex(CalendarsColumns.NAME); 1240fbfc30aSopenharmony_ci indexes.calendarDisplayNameIndex = resultSet.getColumnIndex(CalendarsColumns.CALENDAR_DISPLAY_NAME); 1250fbfc30aSopenharmony_ci indexes.calendarColorIndex = resultSet.getColumnIndex(CalendarsColumns.CALENDAR_COLOR); 1260fbfc30aSopenharmony_ci indexes.calendarColorIndexIndex = resultSet.getColumnIndex(CalendarsColumns.CALENDAR_COLOR_INDEX); 1270fbfc30aSopenharmony_ci indexes.calendarAccessLevelIndex = resultSet.getColumnIndex(CalendarsColumns.CALENDAR_ACCESS_LEVEL); 1280fbfc30aSopenharmony_ci indexes.visibleIndex = resultSet.getColumnIndex(CalendarsColumns.VISIBLE); 1290fbfc30aSopenharmony_ci indexes.syncEventsIndex = resultSet.getColumnIndex(CalendarsColumns.SYNC_EVENTS); 1300fbfc30aSopenharmony_ci indexes.calendarLocationIndex = resultSet.getColumnIndex(CalendarsColumns.CALENDAR_LOCATION); 1310fbfc30aSopenharmony_ci indexes.calendarTimezoneIndex = resultSet.getColumnIndex(CalendarsColumns.CALENDAR_TIMEZONE); 1320fbfc30aSopenharmony_ci indexes.ownerAccountIndex = resultSet.getColumnIndex(CalendarsColumns.OWNER_ACCOUNT); 1330fbfc30aSopenharmony_ci indexes.isPrimaryIndex = resultSet.getColumnIndex(CalendarsColumns.IS_PRIMARY); 1340fbfc30aSopenharmony_ci indexes.canOrganizerRespondIndex = resultSet.getColumnIndex(CalendarsColumns.CAN_ORGANIZER_RESPOND); 1350fbfc30aSopenharmony_ci indexes.canModifyTimeZoneIndex = resultSet.getColumnIndex(CalendarsColumns.CAN_MODIFY_TIMEZONE); 1360fbfc30aSopenharmony_ci indexes.canPartiallyUpdateIndex = resultSet.getColumnIndex(CalendarsColumns.CAN_PARTIALLY_UPDATE); 1370fbfc30aSopenharmony_ci indexes.maxRemindersIndex = resultSet.getColumnIndex(CalendarsColumns.MAX_REMINDERS); 1380fbfc30aSopenharmony_ci indexes.allowedRemindersIndex = resultSet.getColumnIndex(CalendarsColumns.ALLOWED_REMINDERS); 1390fbfc30aSopenharmony_ci indexes.allowedAvailabilityIndex = resultSet.getColumnIndex(CalendarsColumns.ALLOWED_AVAILABILITY); 1400fbfc30aSopenharmony_ci indexes.allowedAttendeeTypesIndex = resultSet.getColumnIndex(CalendarsColumns.ALLOWED_ATTENDEE_TYPES); 1410fbfc30aSopenharmony_ci indexes.deletedIndex = resultSet.getColumnIndex(CalendarsColumns.DELETED); 1420fbfc30aSopenharmony_ci indexes.calendarTimeStampIndex = resultSet.getColumnIndex(CalendarsColumns.CALENDAR_TIME_STAMP); 1430fbfc30aSopenharmony_ci indexes.calSync1Index = resultSet.getColumnIndex(CalendarsColumns.CAL_SYNC1); 1440fbfc30aSopenharmony_ci indexes.calSync2Index = resultSet.getColumnIndex(CalendarsColumns.CAL_SYNC2); 1450fbfc30aSopenharmony_ci indexes.calSync3Index = resultSet.getColumnIndex(CalendarsColumns.CAL_SYNC3); 1460fbfc30aSopenharmony_ci indexes.calSync4Index = resultSet.getColumnIndex(CalendarsColumns.CAL_SYNC4); 1470fbfc30aSopenharmony_ci indexes.calSync5Index = resultSet.getColumnIndex(CalendarsColumns.CAL_SYNC5); 1480fbfc30aSopenharmony_ci indexes.calSync6Index = resultSet.getColumnIndex(CalendarsColumns.CAL_SYNC6); 1490fbfc30aSopenharmony_ci indexes.calSync7Index = resultSet.getColumnIndex(CalendarsColumns.CAL_SYNC7); 1500fbfc30aSopenharmony_ci indexes.calSync8Index = resultSet.getColumnIndex(CalendarsColumns.CAL_SYNC8); 1510fbfc30aSopenharmony_ci indexes.calSync9Index = resultSet.getColumnIndex(CalendarsColumns.CAL_SYNC9); 1520fbfc30aSopenharmony_ci indexes.calSync10Index = resultSet.getColumnIndex(CalendarsColumns.CAL_SYNC10); 1530fbfc30aSopenharmony_ci indexes.canReminderIndex = resultSet.getColumnIndex(CalendarsColumns.CAN_REMINDER); 1540fbfc30aSopenharmony_ci indexes.creatorIndex = resultSet.getColumnIndex(CalendarsColumns.CREATOR); 1550fbfc30aSopenharmony_ci return indexes; 1560fbfc30aSopenharmony_ci}