├── .gitignore ├── Bird10 ├── .cproject ├── .project ├── BB10_splash_twitter_blackbkg1280x720.png ├── BB10_splash_twitter_blackbkg1280x768.png ├── BB10_splash_twitter_blackbkg1440x1440.png ├── BB10_splash_twitter_blackbkg720.png ├── BB10_splash_twitter_blackbkg720x1280.png ├── Bird10.pro ├── Makefile ├── assets │ ├── .assets.index │ ├── 1440x1440 │ │ ├── AttachedImage.qml │ │ ├── EmojiComponent.qml │ │ └── ScreenContainer.qml │ ├── 720x1280 │ │ ├── AttachedImage.qml │ │ ├── EmojiComponent.qml │ │ └── ScreenContainer.qml │ ├── 720x720 │ │ ├── AttachedImage.qml │ │ ├── EmojiComponent.qml │ │ └── ScreenContainer.qml │ ├── 768x1280 │ │ ├── AttachedImage.qml │ │ ├── EmojiComponent.qml │ │ └── ScreenContainer.qml │ ├── About.qml │ ├── BlackSheet.qml │ ├── BrowserSheet.qml │ ├── ConversationPage.qml │ ├── DMAttachmentPage.qml │ ├── DMConversationPage.qml │ ├── DMInbox.qml │ ├── DMInboxPage.qml │ ├── DiscoverPage.qml │ ├── FleetPage.qml │ ├── ItemPage.qml │ ├── ItemPage_scroll.qml │ ├── ListPage.qml │ ├── ListsPage.qml │ ├── LoginSheet.qml │ ├── NotificationsPage.qml │ ├── ProfileMediaPage.qml │ ├── Search.qml │ ├── SettingsSheet.qml │ ├── TopBlueBarText.qml │ ├── TweetList.qml │ ├── TweetSheet.qml │ ├── UserProfile.qml │ ├── UserProfile_androidlike.qml │ ├── UserTweets.qml │ ├── VideoPage.qml │ ├── VisualStyle.bright │ │ ├── btn_compose_tweet.png │ │ ├── btn_default_camera.png │ │ ├── btn_default_gallery.png │ │ ├── btn_emoji.png │ │ ├── btn_video.png │ │ ├── fleet_border.png │ │ ├── fleet_border_blue.png │ │ ├── poll_button_disabled.amd │ │ ├── poll_button_disabled.png │ │ ├── quoted_border.amd │ │ ├── quoted_border.png │ │ ├── thread_bar.amd │ │ ├── thread_bar.png │ │ ├── three_dots.amd │ │ └── three_dots.png │ ├── VisualStyle.dark │ │ ├── btn_compose_tweet.png │ │ ├── btn_default_camera.png │ │ ├── btn_default_gallery.png │ │ ├── btn_emoji.png │ │ ├── btn_video.png │ │ ├── fleet_border.png │ │ ├── fleet_border_blue.png │ │ ├── poll_button_disabled.amd │ │ ├── poll_button_disabled.png │ │ ├── quoted_border.amd │ │ ├── quoted_border.png │ │ ├── thread_bar.amd │ │ ├── thread_bar.png │ │ ├── three_dots.amd │ │ └── three_dots.png │ ├── components │ │ ├── ArrowItemComponent.qml │ │ ├── BaseTweetContainer.qml │ │ ├── BigPic.qml │ │ ├── CardComponent.qml │ │ ├── DMCompose.qml │ │ ├── DMConversationComponent.qml │ │ ├── DMEmojiPicker.qml │ │ ├── DMMessageComponent.qml │ │ ├── DMPhotoCard.qml │ │ ├── GifTweetComponent.qml │ │ ├── GifTweetComponentMain.qml │ │ ├── ImageTweetComponent.qml │ │ ├── ImageTweetComponentMain.qml │ │ ├── LargeSummaryCard.qml │ │ ├── LoadingComponent.qml │ │ ├── NotificationTweetComponent.qml │ │ ├── PlayerCard.qml │ │ ├── PollButtonEntry.qml │ │ ├── PollResultEntry.qml │ │ ├── PollTweetComponent.qml │ │ ├── PollTweetComponentMain.qml │ │ ├── ProfileHeaderBottom.qml │ │ ├── ProfileHeaderTop.qml │ │ ├── ProfilePic.qml │ │ ├── ProfilePicMain.qml │ │ ├── ProfilesList.qml │ │ ├── QmlTimer.qml │ │ ├── QuotedTweetComponent.qml │ │ ├── RtContainer.qml │ │ ├── ShowThreadComponent.qml │ │ ├── SummaryCard.qml │ │ ├── TimelinePage.qml │ │ ├── TweetActionBar.qml │ │ ├── TweetActionBarMain.qml │ │ ├── TweetAuthorMain.qml │ │ ├── TweetComponent.qml │ │ ├── TweetComponentMain.qml │ │ ├── TweetHeader.qml │ │ ├── TweetItem.qml │ │ ├── TweetTextHandler.qml │ │ ├── VideoTweetComponent.qml │ │ ├── VideoTweetComponentMain.qml │ │ ├── Waiter.qml │ │ └── actions │ │ │ ├── LoginAction.qml │ │ │ ├── PayAction.qml │ │ │ ├── RefreshAction.qml │ │ │ └── ScrollToTop.qml │ ├── favorites.qml │ ├── fonts │ │ └── Twemoji.ttf │ ├── images │ │ ├── add_to_list_80x80.png │ │ ├── bird_logo_white.png │ │ ├── btn_default_photo_gallery.png │ │ ├── btn_emoji_flags.png │ │ ├── btn_emoji_food.png │ │ ├── btn_emoji_nature.png │ │ ├── btn_emoji_objects.png │ │ ├── btn_emoji_people.png │ │ ├── btn_emoji_places.png │ │ ├── btn_emoji_square.png │ │ ├── btn_emoji_symbols.png │ │ ├── btn_pressed_photo_gallery.png │ │ ├── bubble_arrow_blue.png │ │ ├── bubble_arrow_gray.png │ │ ├── card_null.png │ │ ├── chat_bubble_blue.amd │ │ ├── chat_bubble_blue.png │ │ ├── chat_bubble_gray.amd │ │ ├── chat_bubble_gray.png │ │ ├── default_profile_image.png │ │ ├── delete_80x80.png │ │ ├── emoji_activity.xml │ │ ├── emoji_flags.xml │ │ ├── emoji_foods.xml │ │ ├── emoji_nature.xml │ │ ├── emoji_objects.xml │ │ ├── emoji_people.xml │ │ ├── emoji_places.xml │ │ ├── emoji_symbols.xml │ │ ├── fleet_gradient.png │ │ ├── heart.png │ │ ├── heart_grey.png │ │ ├── heart_red.png │ │ ├── home_80x80.png │ │ ├── ic_collapse.png │ │ ├── ic_doctype_video.png │ │ ├── ic_done.png │ │ ├── ic_done_black.png │ │ ├── ic_expand.png │ │ ├── ic_open.png │ │ ├── ic_resume.png │ │ ├── ic_save.png │ │ ├── ic_to_top.png │ │ ├── icn_compose_focused_100x100.png │ │ ├── icn_compose_white_100x100.png │ │ ├── icn_search_focused_100x100.png │ │ ├── icn_search_white_100x100.png │ │ ├── image_mask.amd │ │ ├── image_mask.png │ │ ├── image_mask_dark.amd │ │ ├── image_mask_dark.png │ │ ├── link.png │ │ ├── logo.png │ │ ├── logout.png │ │ ├── mail_80x80.png │ │ ├── me_80x80.png │ │ ├── messages_80x80.png │ │ ├── new_msg.png │ │ ├── notifications_80x80.png │ │ ├── notifications_active_80x80.png │ │ ├── play-50x50.png │ │ ├── play.png │ │ ├── poll_button.amd │ │ ├── poll_button.png │ │ ├── profile │ │ │ ├── avatar_border.amd │ │ │ ├── avatar_border.png │ │ │ ├── dark_background.png │ │ │ ├── follow.png │ │ │ ├── icn_lock_sm.png │ │ │ ├── list_item_chevron.png │ │ │ ├── profile_pic_gradient.png │ │ │ ├── profile_position-gray.png │ │ │ ├── profile_position-white.png │ │ │ ├── profile_position.png │ │ │ ├── tweet_tile_bkg-pressed.png │ │ │ ├── tweet_tile_bkg.png │ │ │ ├── tweet_tile_bkg_invers.png │ │ │ ├── unfollow.png │ │ │ └── verified_profile.png │ │ ├── reply_hvr_80x80.png │ │ ├── reply_on_hvr_80x80.png │ │ ├── retweet_80x80.png │ │ ├── retweet_green.png │ │ ├── retweet_grey.png │ │ ├── retweet_on_80x80.png │ │ ├── rounded9slice.amd │ │ ├── rounded9slice.png │ │ ├── search_cancel.png │ │ ├── share_tweet.png │ │ ├── share_tweet_hvr.png │ │ ├── share_tweet_white.png │ │ └── twitterheart.png │ ├── main.qml │ ├── tl.qml │ └── user.qml ├── bar-descriptor.xml ├── config.pri ├── icon.png ├── precompiled.h ├── src │ ├── Conversation.cpp │ ├── Conversation.hpp │ ├── ConversationApi.cpp │ ├── ConversationApi.hpp │ ├── DMApi.cpp │ ├── DMApi.hpp │ ├── DiscoverApi.cpp │ ├── DiscoverApi.hpp │ ├── FleetApi.cpp │ ├── FleetApi.hpp │ ├── ListApi.cpp │ ├── ListApi.hpp │ ├── MediaUploader.cpp │ ├── MediaUploader.hpp │ ├── NotificationsApi.cpp │ ├── NotificationsApi.hpp │ ├── ProfileApi.cpp │ ├── ProfileApi.hpp │ ├── QJson4 │ │ ├── QJsonArray.cpp │ │ ├── QJsonArray.h │ │ ├── QJsonDocument.cpp │ │ ├── QJsonDocument.h │ │ ├── QJsonObject.cpp │ │ ├── QJsonObject.h │ │ ├── QJsonParseError.cpp │ │ ├── QJsonParseError.h │ │ ├── QJsonParser.cpp │ │ ├── QJsonParser.h │ │ ├── QJsonRoot.h │ │ ├── QJsonValue.cpp │ │ ├── QJsonValue.h │ │ ├── QJsonValueRef.cpp │ │ └── QJsonValueRef.h │ ├── QtCurl │ │ ├── CurlEasy.cpp │ │ ├── CurlEasy.h │ │ ├── CurlMulti.cpp │ │ └── CurlMulti.h │ ├── RetweetDialog.cpp │ ├── RetweetDialog.hpp │ ├── SearchApi.cpp │ ├── SearchApi.hpp │ ├── TimelineBase.cpp │ ├── TimelineBase.hpp │ ├── TimelineDataModel.cpp │ ├── TimelineDataModel.hpp │ ├── Timer.cpp │ ├── Timer.hpp │ ├── TweetApi.cpp │ ├── TweetApi.hpp │ ├── TwitterApiBase.cpp │ ├── TwitterApiBase.hpp │ ├── WebImageView │ │ ├── AuthorizedWebImageView.cpp │ │ ├── AuthorizedWebImageView.hpp │ │ ├── WebImageView.cpp │ │ └── WebImageView.h │ ├── applicationui.cpp │ ├── applicationui.hpp │ ├── main.cpp │ ├── o2 │ │ ├── o0abstractstore.h │ │ ├── o0baseauth.cpp │ │ ├── o0baseauth.h │ │ ├── o0export.h │ │ ├── o0globals.h │ │ ├── o0requestparameter.h │ │ ├── o0settingsstore.cpp │ │ ├── o0settingsstore.h │ │ ├── o0simplecrypt.h │ │ ├── o1.cpp │ │ ├── o1.h │ │ ├── o1freshbooks.h │ │ ├── o1requestor.cpp │ │ ├── o1requestor.h │ │ ├── o1timedreply.cpp │ │ ├── o1timedreply.h │ │ ├── o1twitter.h │ │ ├── o2.cpp │ │ ├── o2.h │ │ ├── o2.pri │ │ ├── o2gft.cpp │ │ ├── o2gft.h │ │ ├── o2reply.cpp │ │ ├── o2reply.h │ │ ├── o2replyserver.cpp │ │ ├── o2replyserver.h │ │ ├── o2requestor.cpp │ │ ├── o2requestor.h │ │ ├── o2simplecrypt.cpp │ │ ├── oxtwitter.cpp │ │ ├── oxtwitter.h │ │ └── src.pri │ ├── secret.h │ ├── twitterapi.cpp │ └── twitterapi.hpp └── translations │ ├── CascadesProject.pro │ ├── CascadesProject.ts │ └── Makefile ├── Bird10HeadlessService ├── .cproject ├── .project ├── Bird10HeadlessService.pro ├── Makefile ├── config.pri ├── precompiled.h ├── src │ ├── DMApi.cpp │ ├── DMApi.hpp │ ├── DMNotificator.cpp │ ├── DMNotificator.hpp │ ├── NotificationsApi.cpp │ ├── NotificationsApi.hpp │ ├── Notificator.cpp │ ├── Notificator.hpp │ ├── QJson4 │ │ ├── QJsonArray.cpp │ │ ├── QJsonArray.h │ │ ├── QJsonDocument.cpp │ │ ├── QJsonDocument.h │ │ ├── QJsonObject.cpp │ │ ├── QJsonObject.h │ │ ├── QJsonParseError.cpp │ │ ├── QJsonParseError.h │ │ ├── QJsonParser.cpp │ │ ├── QJsonParser.h │ │ ├── QJsonRoot.h │ │ ├── QJsonValue.cpp │ │ ├── QJsonValue.h │ │ ├── QJsonValueRef.cpp │ │ └── QJsonValueRef.h │ ├── QtCurl │ │ ├── CurlEasy.cpp │ │ ├── CurlEasy.h │ │ ├── CurlMulti.cpp │ │ └── CurlMulti.h │ ├── TwitterApiBase.cpp │ ├── TwitterApiBase.hpp │ ├── logger │ │ ├── logger.cpp │ │ └── logger.h │ ├── main.cpp │ ├── o2 │ │ ├── o0abstractstore.h │ │ ├── o0baseauth.cpp │ │ ├── o0baseauth.h │ │ ├── o0export.h │ │ ├── o0globals.h │ │ ├── o0requestparameter.h │ │ ├── o0settingsstore.cpp │ │ ├── o0settingsstore.h │ │ ├── o0simplecrypt.h │ │ ├── o1.cpp │ │ ├── o1.h │ │ ├── o1freshbooks.h │ │ ├── o1requestor.cpp │ │ ├── o1requestor.h │ │ ├── o1timedreply.cpp │ │ ├── o1timedreply.h │ │ ├── o1twitter.h │ │ ├── o2.pri │ │ ├── o2reply.cpp │ │ ├── o2reply.h │ │ ├── o2replyserver.cpp │ │ ├── o2replyserver.h │ │ ├── o2simplecrypt.cpp │ │ ├── oxtwitter.cpp │ │ ├── oxtwitter.h │ │ └── src.pri │ ├── secret.h │ ├── service.cpp │ └── service.hpp └── translations │ ├── Bird10HeadlessService.pro │ ├── Bird10HeadlessService.qm │ ├── Bird10HeadlessService.ts │ └── Makefile └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | */arm/ 3 | 4 | */.settings/ 5 | 6 | */logs/ 7 | 8 | */.svn/ 9 | 10 | *.core 11 | 12 | *.txt 13 | 14 | Bird10/src/legacysecret.h 15 | -------------------------------------------------------------------------------- /Bird10/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Bird10 4 | 5 | 6 | 7 | 8 | 9 | com.rim.tad.tools.qml.core.qmlFileBuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.jsdt.core.javascriptValidator 20 | 21 | 22 | 23 | 24 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 25 | auto,full,incremental, 26 | 27 | 28 | 29 | 30 | com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder 31 | 32 | 33 | 34 | 35 | 36 | org.eclipse.wst.jsdt.core.jsNature 37 | org.eclipse.cdt.core.cnature 38 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 39 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 40 | com.qnx.tools.ide.bbt.core.bbtnature 41 | org.eclipse.cdt.core.ccnature 42 | org.eclipse.cdt.qt.core.qtNature 43 | com.rim.tad.tools.qml.core.qmlNature 44 | 45 | 46 | -------------------------------------------------------------------------------- /Bird10/BB10_splash_twitter_blackbkg1280x720.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/BB10_splash_twitter_blackbkg1280x720.png -------------------------------------------------------------------------------- /Bird10/BB10_splash_twitter_blackbkg1280x768.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/BB10_splash_twitter_blackbkg1280x768.png -------------------------------------------------------------------------------- /Bird10/BB10_splash_twitter_blackbkg1440x1440.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/BB10_splash_twitter_blackbkg1440x1440.png -------------------------------------------------------------------------------- /Bird10/BB10_splash_twitter_blackbkg720.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/BB10_splash_twitter_blackbkg720.png -------------------------------------------------------------------------------- /Bird10/BB10_splash_twitter_blackbkg720x1280.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/BB10_splash_twitter_blackbkg720x1280.png -------------------------------------------------------------------------------- /Bird10/Bird10.pro: -------------------------------------------------------------------------------- 1 | APP_NAME = Bird10 2 | 3 | CONFIG += qt warn_on cascades10 4 | LIBS += -lbbdata 5 | LIBS += -lbbsystem 6 | LIBS += -lbbdevice 7 | LIBS += -lbb -lbbcascadesdatamanager 8 | LIBS += -lcURL -lcrypto 9 | 10 | QT += network sql 11 | 12 | include(config.pri) 13 | 14 | -------------------------------------------------------------------------------- /Bird10/Makefile: -------------------------------------------------------------------------------- 1 | QMAKE_TARGET = Bird10 2 | PROJECT_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) 3 | I18N_DIR := $(PROJECT_DIR)/translations 4 | 5 | include mk/cs-base.mk 6 | 7 | -------------------------------------------------------------------------------- /Bird10/assets/1440x1440/AttachedImage.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | ImageView { 23 | preferredWidth: 340 24 | preferredHeight: 340 25 | scalingMethod: ScalingMethod.AspectFit 26 | visible: imageSource != "" 27 | } -------------------------------------------------------------------------------- /Bird10/assets/1440x1440/EmojiComponent.qml: -------------------------------------------------------------------------------- 1 | import bb.cascades 1.4 2 | 3 | ListItemComponent { 4 | type: "emoji" 5 | Label { 6 | text: ListItemData.unicode 7 | textStyle.textAlign: TextAlign.Center 8 | textStyle.fontSize: FontSize.PointValue 9 | textStyle.fontSizeValue: 16 10 | textStyle.base: ListItem.view.twemojiStyle 11 | textStyle.fontFamily: "Twemoji" 12 | textFormat: TextFormat.Html 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Bird10/assets/1440x1440/ScreenContainer.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | Container { 23 | verticalAlignment: VerticalAlignment.Fill 24 | maxWidth: 1440 25 | minWidth: 1440 26 | } 27 | -------------------------------------------------------------------------------- /Bird10/assets/720x1280/AttachedImage.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | ImageView { 23 | preferredWidth: 150 24 | preferredHeight: 150 25 | scalingMethod: ScalingMethod.AspectFit 26 | visible: imageSource != "" 27 | } -------------------------------------------------------------------------------- /Bird10/assets/720x1280/EmojiComponent.qml: -------------------------------------------------------------------------------- 1 | import bb.cascades 1.4 2 | 3 | ListItemComponent { 4 | type: "emoji" 5 | Label { 6 | text: ListItemData.unicode 7 | textStyle.textAlign: TextAlign.Center 8 | textStyle.fontSize: FontSize.PointValue 9 | textStyle.fontSizeValue: 9 10 | textStyle.base: ListItem.view.twemojiStyle 11 | textStyle.fontFamily: "Twemoji" 12 | textFormat: TextFormat.Html 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Bird10/assets/720x1280/ScreenContainer.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | Container { 23 | verticalAlignment: VerticalAlignment.Fill 24 | maxWidth: 720 25 | minWidth: 720 26 | } 27 | -------------------------------------------------------------------------------- /Bird10/assets/720x720/AttachedImage.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | ImageView { 23 | preferredWidth: 150 24 | preferredHeight: 150 25 | scalingMethod: ScalingMethod.AspectFit 26 | visible: imageSource != "" && imageSource != null 27 | onImageSourceChanged: { 28 | console.debug("new source: " + imageSource) 29 | if(imageSource == "") 30 | resetImage() 31 | } 32 | } -------------------------------------------------------------------------------- /Bird10/assets/720x720/EmojiComponent.qml: -------------------------------------------------------------------------------- 1 | import bb.cascades 1.4 2 | 3 | ListItemComponent { 4 | type: "emoji" 5 | Label { 6 | text: ListItemData.unicode 7 | textStyle.textAlign: TextAlign.Center 8 | textStyle.fontSize: FontSize.PointValue 9 | textStyle.fontSizeValue: 9 10 | textStyle.base: ListItem.view.twemojiStyle 11 | textStyle.fontFamily: "Twemoji" 12 | textFormat: TextFormat.Html 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Bird10/assets/720x720/ScreenContainer.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | Container { 23 | verticalAlignment: VerticalAlignment.Fill 24 | maxWidth: 720 25 | minWidth: 720 26 | } 27 | -------------------------------------------------------------------------------- /Bird10/assets/768x1280/AttachedImage.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | ImageView { 23 | preferredWidth: 160 24 | preferredHeight: 160 25 | scalingMethod: ScalingMethod.AspectFit 26 | visible: imageSource != "" 27 | } -------------------------------------------------------------------------------- /Bird10/assets/768x1280/EmojiComponent.qml: -------------------------------------------------------------------------------- 1 | import bb.cascades 1.4 2 | 3 | ListItemComponent { 4 | type: "emoji" 5 | Label { 6 | text: ListItemData.unicode 7 | textStyle.textAlign: TextAlign.Center 8 | textStyle.fontSize: FontSize.PointValue 9 | textStyle.fontSizeValue: 9 10 | textStyle.base: ListItem.view.twemojiStyle 11 | textStyle.fontFamily: "Twemoji" 12 | textFormat: TextFormat.Html 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Bird10/assets/768x1280/ScreenContainer.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | Container { 23 | verticalAlignment: VerticalAlignment.Fill 24 | maxWidth: 768 25 | minWidth: 768 26 | } 27 | -------------------------------------------------------------------------------- /Bird10/assets/About.qml: -------------------------------------------------------------------------------- 1 | import bb.cascades 1.4 2 | 3 | Sheet { 4 | id: aboutSheet 5 | Page { 6 | titleBar: TitleBar { 7 | title: "Bird10 for BlackBerry" 8 | dismissAction: ActionItem { 9 | title: "Close" 10 | onTriggered: { 11 | aboutSheet.close() 12 | } 13 | } 14 | } 15 | ScrollView { 16 | horizontalAlignment: HorizontalAlignment.Fill 17 | Container { 18 | horizontalAlignment: HorizontalAlignment.Fill 19 | topPadding: ui.du(5) 20 | bottomPadding: topPadding 21 | leftPadding: topPadding 22 | rightPadding: topPadding 23 | ImageView { 24 | imageSource: "asset:///images/logo.png" 25 | horizontalAlignment: HorizontalAlignment.Center 26 | bottomPadding: ui.du(5) 27 | scalingMethod: ScalingMethod.AspectFit 28 | maxHeight: ui.du(35) 29 | } 30 | Label { 31 | text: "A Native Twitter Client for BlackBerry 10 " 32 | horizontalAlignment: HorizontalAlignment.Center 33 | textStyle.textAlign: TextAlign.Center 34 | multiline: true 35 | } 36 | Label { 37 | text: "\nYou can find the source code for this app at \nhttps://github.com/SimoDax/Bird10" 38 | horizontalAlignment: HorizontalAlignment.Center 39 | textStyle.textAlign: TextAlign.Center 40 | multiline: true 41 | content.flags: TextContentFlag.ActiveText 42 | } 43 | } 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /Bird10/assets/BlackSheet.qml: -------------------------------------------------------------------------------- 1 | import bb.cascades 1.4 2 | 3 | Sheet { 4 | id: blackSheet 5 | 6 | onCreationCompleted: { 7 | app.showBlackBg.connect(blackSheet.open) 8 | app.hideBlackBg.connect(blackSheet.close) 9 | } 10 | 11 | Page { 12 | Container { 13 | layout: DockLayout { 14 | } 15 | verticalAlignment: VerticalAlignment.Fill 16 | horizontalAlignment: HorizontalAlignment.Fill 17 | background: Color.Black 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Bird10/assets/BrowserSheet.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | Sheet { 23 | id: browser 24 | property url url 25 | 26 | content: Page { 27 | ScrollView { 28 | verticalAlignment: VerticalAlignment.Fill 29 | WebView { 30 | id: webView 31 | url: browser.url 32 | verticalAlignment: VerticalAlignment.Fill 33 | // I'm an iPhone i swear 34 | settings.userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.1 Mobile/15E148 Safari/604.1" 35 | // besides, they copied keyless navigation from bb10 devices.. 36 | 37 | onUrlChanged: { 38 | console.debug("Browser url: " + url) 39 | if(url == "https://twitter.com/account/login_challenge/success" || url == "https://twitter.com/account/login_verification/success") 40 | o1Twitter.onChallengeSuccess(); 41 | } 42 | } 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Bird10/assets/DMAttachmentPage.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | Page { 23 | property alias image: imageView.image 24 | 25 | Container { 26 | attachedObjects: LayoutUpdateHandler { 27 | property alias height: pageSize.layoutFrame.height 28 | property alias width: pageSize.layoutFrame.width 29 | id: pageSize 30 | } 31 | 32 | horizontalAlignment: HorizontalAlignment.Fill 33 | verticalAlignment: VerticalAlignment.Fill 34 | layout: DockLayout { 35 | } 36 | ScrollView { 37 | id: scrollView 38 | horizontalAlignment: HorizontalAlignment.Fill 39 | verticalAlignment: VerticalAlignment.Fill 40 | 41 | scrollViewProperties { 42 | minContentScale: 1 43 | initialScalingMethod: ScalingMethod.AspectFill 44 | scrollMode: ScrollMode.Both 45 | pinchToZoomEnabled: true 46 | overScrollEffectMode: OverScrollEffectMode.None 47 | } 48 | 49 | Container{ 50 | maxHeight: pageSize.height 51 | maxWidth: pageSize.width 52 | 53 | ImageView { 54 | id: imageView 55 | horizontalAlignment: HorizontalAlignment.Center 56 | verticalAlignment: VerticalAlignment.Center 57 | scalingMethod: ScalingMethod.AspectFit 58 | maxHeight: pageSize.height 59 | maxWidth: pageSize.width 60 | minWidth: pageSize.width 61 | minHeight: pageSize.height 62 | } 63 | } 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Bird10/assets/ListPage.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | import com.simodax 1.0 22 | import "/components" 23 | import "/components/actions" 24 | 25 | Page { 26 | property alias listId: twitterApi.listId 27 | property alias name: topBar.text 28 | property alias twitterApi: twitterApi 29 | 30 | 31 | Container { 32 | verticalAlignment: VerticalAlignment.Fill 33 | 34 | TopBlueBarText { 35 | id: topBar 36 | horizontalAlignment: HorizontalAlignment.Fill 37 | searchVisible: false 38 | } 39 | 40 | TweetList { 41 | id: tweetList 42 | 43 | attachedObjects: [ 44 | ListScrollStateHandler { 45 | onAtEndChanged: { 46 | if (atEnd && twitterApi.tweetModel.size() != 0 && twitterApi.tweetModel.size() < 500) 47 | twitterApi.requestOlderTweets() 48 | } 49 | } 50 | ] 51 | } 52 | } 53 | 54 | actions: [ 55 | ScrollToTop { 56 | id: scrollToTopAction 57 | }, 58 | RefreshAction { 59 | id: refreshAction 60 | onTriggered: { 61 | twitterApi.requestTweets() 62 | } 63 | }, 64 | LoginAction { 65 | id: loginAction 66 | }, 67 | PayAction { 68 | id: payAction 69 | } 70 | ] 71 | attachedObjects: [ 72 | ListApi { 73 | id: twitterApi 74 | authenticator: o1Twitter 75 | onError: { 76 | error_message(error) 77 | } 78 | onNetworkError: { 79 | error_message("Network error") 80 | } 81 | } 82 | ] 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Bird10/assets/VideoPage.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | import org.labsquare 1.0 22 | 23 | Page { 24 | property alias windowId: fwcVideoSurface.windowId 25 | 26 | titleBar: TitleBar { 27 | id: titlebar 28 | } 29 | Container { 30 | verticalAlignment: VerticalAlignment.Fill 31 | horizontalAlignment: HorizontalAlignment.Fill 32 | 33 | ForeignWindowControl { 34 | id: fwcVideoSurface 35 | windowId:"myWinId" 36 | visible: boundToWindow 37 | updatedProperties: WindowProperty.Size | WindowProperty.Position | WindowProperty.Visible 38 | } 39 | } 40 | actions: [ 41 | ActionItem { 42 | id: playpause 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/btn_compose_tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.bright/btn_compose_tweet.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/btn_default_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.bright/btn_default_camera.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/btn_default_gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.bright/btn_default_gallery.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/btn_emoji.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.bright/btn_emoji.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/btn_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.bright/btn_video.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/fleet_border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.bright/fleet_border.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/fleet_border_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.bright/fleet_border_blue.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/poll_button_disabled.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "poll_button_disabled.png" 3 | sliceMargins: 3 3 3 3 -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/poll_button_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.bright/poll_button_disabled.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/quoted_border.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "quoted_border.png" 3 | sliceMargins: 2 2 2 2 -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/quoted_border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.bright/quoted_border.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/thread_bar.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "thread_bar.png" 3 | sliceMargins: 100 3 111 15 -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/thread_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.bright/thread_bar.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/three_dots.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "three_dots.png" 3 | sliceMargins: 100 3 10 1 -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.bright/three_dots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.bright/three_dots.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/btn_compose_tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.dark/btn_compose_tweet.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/btn_default_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.dark/btn_default_camera.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/btn_default_gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.dark/btn_default_gallery.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/btn_emoji.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.dark/btn_emoji.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/btn_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.dark/btn_video.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/fleet_border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.dark/fleet_border.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/fleet_border_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.dark/fleet_border_blue.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/poll_button_disabled.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "poll_button_disabled.png" 3 | sliceMargins: 3 3 3 3 -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/poll_button_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.dark/poll_button_disabled.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/quoted_border.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "quoted_border.png" 3 | sliceMargins: 2 2 2 2 -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/quoted_border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.dark/quoted_border.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/thread_bar.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "thread_bar.png" 3 | sliceMargins: 100 3 111 15 -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/thread_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.dark/thread_bar.png -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/three_dots.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "three_dots.png" 3 | sliceMargins: 100 3 10 1 -------------------------------------------------------------------------------- /Bird10/assets/VisualStyle.dark/three_dots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/VisualStyle.dark/three_dots.png -------------------------------------------------------------------------------- /Bird10/assets/components/CardComponent.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | Container { 23 | PlayerCard { 24 | } 25 | SummaryCard { 26 | } 27 | LargeSummaryCard { 28 | } 29 | } -------------------------------------------------------------------------------- /Bird10/assets/components/DMPhotoCard.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | import org.labsquare 1.0 22 | 23 | Container { 24 | id: photoContainer 25 | property variant listViewHandle 26 | 27 | 28 | preferredWidth: HorizontalAlignment.Fill 29 | AuthorizedWebImageView { 30 | authenticator: { 31 | console.debug(dmListItem.authenticator); 32 | return dmListItem.authenticator; 33 | } 34 | id: photoImage 35 | // defaultUrl: "asset:///images/lists/default_placeholder.png" 36 | url: ListItemData.photoUrlSmall 37 | maxHeight: (300) 38 | minHeight: (200) 39 | preferredHeight: 300 40 | horizontalAlignment: HorizontalAlignment.Fill 41 | verticalAlignment: VerticalAlignment.Fill 42 | scalingMethod: ScalingMethod.AspectFit 43 | // persistent: true 44 | gestureHandlers: [ 45 | TapHandler { 46 | onTapped: { 47 | photoImage.clicked() 48 | } 49 | } 50 | ] 51 | 52 | 53 | 54 | function clicked() { 55 | listViewHandle.openFullScreenImage(photoImage); 56 | } 57 | 58 | onCreationCompleted: { 59 | // compatibilityManager.setFocusable(photoImage, true); 60 | 61 | //sometimes, the card is created then being recyled ( due to user fast scrolling or gap item) 62 | //in that case, the defaul url is not set. then, later on, if network image error happens, we will show some wrong image ( due to recycle) 63 | //make sure the default url is set 64 | // defaultUrl = "asset:///images/lists/default_placeholder.png" 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Bird10/assets/components/LoadingComponent.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | ListItemComponent { 23 | type: "loading" 24 | Container { 25 | //id: itemRoot 26 | preferredWidth: Infinity 27 | preferredHeight: 200 28 | topPadding: 15.0 29 | leftPadding: 15.0 30 | rightPadding: 15.0 31 | bottomPadding: 15.0 32 | layout: DockLayout { 33 | } 34 | 35 | ActivityIndicator { 36 | running: true 37 | preferredHeight: 100 38 | verticalAlignment: VerticalAlignment.Center 39 | horizontalAlignment: HorizontalAlignment.Center 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Bird10/assets/components/PollButtonEntry.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | Container { 23 | property int index 24 | property alias text: lbl.text 25 | horizontalAlignment: HorizontalAlignment.Fill 26 | verticalAlignment: VerticalAlignment.Fill 27 | topPadding: ui.du(.5) 28 | bottomPadding: ui.du(.5) 29 | layout: DockLayout { 30 | 31 | } 32 | Container { 33 | verticalAlignment: VerticalAlignment.Center 34 | horizontalAlignment: HorizontalAlignment.Center 35 | topPadding: ui.du(1.5) 36 | bottomPadding: ui.du(1.5) 37 | Label { 38 | id: lbl 39 | verticalAlignment: VerticalAlignment.Center 40 | horizontalAlignment: HorizontalAlignment.Center 41 | } 42 | } 43 | ImageButton { 44 | defaultImageSource: "asset:///images/poll_button.amd" 45 | disabledImageSource: "asset:///poll_button_disabled.amd" 46 | horizontalAlignment: HorizontalAlignment.Fill 47 | verticalAlignment: VerticalAlignment.Fill 48 | onClicked: { 49 | itemRoot.disablePollButtons() 50 | lbl.textStyle.color = Application.themeSupport.theme.colorTheme.primary 51 | itemRoot.ListItem.view.api.votePoll(ListItemData.card.url, ListItemData.id_str, index, ListItemData.poll_choice_count) 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /Bird10/assets/components/ProfilePic.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | import org.labsquare 1.0 22 | 23 | WebImageView { 24 | property alias image_url : profilePic.url 25 | 26 | id: profilePic 27 | url: "http://" + ListItemData.user.profile_image_url_https.substring(8) // replace https with http 28 | //url: ListItemData.user.profile_image_url_https.replace("https","http") 29 | minWidth: 80.0 30 | minHeight: 80.0 31 | maxWidth: minWidth 32 | maxHeight: minHeight 33 | scalingMethod: ScalingMethod.AspectFit 34 | 35 | gestureHandlers: TapHandler { 36 | onTapped: { 37 | tapHandled = true 38 | itemRoot.ListItem.view.openProfile(itemRoot.ListItem.indexPath) 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Bird10/assets/components/ProfilePicMain.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | import org.labsquare 1.0 22 | 23 | WebImageView { 24 | id: profilePic 25 | url: "http://" + ListItemData.user.profile_image_url_https.substring(8) // replace https with http 26 | minWidth: 100.0 27 | minHeight: 100.0 28 | maxWidth: minWidth 29 | maxHeight: minHeight 30 | 31 | gestureHandlers: TapHandler { 32 | onTapped: { 33 | tapHandled = true 34 | itemRoot.ListItem.view.openProfile(itemRoot.ListItem.indexPath) 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Bird10/assets/components/QmlTimer.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | // QmlTimer.qml 21 | import bb.cascades 1.0 22 | 23 | Container { 24 | id: root 25 | visible: false 26 | opacity: 0.0 27 | 28 | property int duration: 0 29 | property bool timerActive: false 30 | 31 | signal triggered 32 | 33 | function start() { 34 | if (duration == 0) { 35 | console.log("timer can't start when duration is 0") 36 | return 37 | } 38 | 39 | if (timerActive == true) { 40 | console.log("timer is already active, not starting") 41 | return 42 | } 43 | 44 | opacity = 0; 45 | timerActive = true; 46 | timerAnimation.play() 47 | } 48 | 49 | function stop() { 50 | timerActive = false 51 | timerAnimation.stop() 52 | } 53 | 54 | animations: [ 55 | FadeTransition { 56 | id: timerAnimation 57 | fromOpacity: 0 58 | toOpacity: 1 59 | duration: root.duration 60 | 61 | onEnded: { 62 | timerActive = false 63 | root.triggered() 64 | } 65 | } 66 | ] 67 | } -------------------------------------------------------------------------------- /Bird10/assets/components/RtContainer.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | Container { 23 | leftPadding: 110 24 | topPadding: 20 25 | horizontalAlignment: HorizontalAlignment.Fill 26 | layout: StackLayout { 27 | orientation: LayoutOrientation.LeftToRight 28 | } 29 | ImageView { 30 | imageSource: "asset:///images/retweet_80x80.png" 31 | scalingMethod: ScalingMethod.AspectFit 32 | minWidth: ui.du(4) 33 | maxWidth: ui.du(4) 34 | verticalAlignment: VerticalAlignment.Center 35 | } 36 | Label { 37 | text: ListItemData.rt_name + " retweeted" 38 | textStyle.color: Color.create("#7A7A7A") 39 | } 40 | } -------------------------------------------------------------------------------- /Bird10/assets/components/ShowThreadComponent.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | ListItemComponent { 23 | id: lic 24 | type: "showThread" 25 | Container { 26 | id: itemRoot 27 | gestureHandlers: TapHandler { 28 | onTapped: { 29 | itemRoot.ListItem.view.openConversation([itemRoot.ListItem.indexPath[0] - 1]) // this component is always placed below the first tweet in the thread 30 | } 31 | } 32 | 33 | layout: DockLayout { 34 | } 35 | preferredWidth: Infinity 36 | leftPadding: 15 37 | topPadding: 15 38 | bottomPadding: 5 39 | 40 | background: bg.imagePaint 41 | 42 | Container { 43 | leftPadding: 110-15 44 | topPadding: 0 45 | bottomPadding: 0 46 | rightPadding: 0 47 | verticalAlignment: VerticalAlignment.Center 48 | 49 | Label { 50 | text: "Show this conversation" 51 | textStyle.color: Application.themeSupport.theme.colorTheme.primary 52 | verticalAlignment: VerticalAlignment.Center 53 | } 54 | } 55 | 56 | attachedObjects: ImagePaintDefinition { 57 | id: bg 58 | imageSource: "asset:///three_dots.amd" 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /Bird10/assets/components/TimelinePage.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | import "/components/actions" 22 | 23 | Page { 24 | // property alias refreshAction: refreshAction 25 | 26 | actionBarAutoHideBehavior: ActionBarAutoHideBehavior.HideOnScroll 27 | actionBarVisibility: app.showTabsOnActionBar ? ChromeVisibility.Visible : ChromeVisibility.Compact 28 | } -------------------------------------------------------------------------------- /Bird10/assets/components/TweetAuthorMain.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | import com.pipacs.o2 1.0 22 | import bb.system 1.2 23 | import org.labsquare 1.0 24 | import bb.multimedia 1.4 25 | 26 | Container { 27 | layout: StackLayout { 28 | orientation: LayoutOrientation.LeftToRight 29 | } 30 | 31 | verticalAlignment: VerticalAlignment.Fill 32 | leftMargin: 15.0 33 | 34 | ProfilePicMain { 35 | } 36 | 37 | Container { 38 | layout: StackLayout { 39 | orientation: LayoutOrientation.TopToBottom 40 | } 41 | leftMargin: 20 42 | 43 | Label { 44 | id: username 45 | text: ListItemData.user.name 46 | //textStyle.fontWeight: FontWeight.Bold 47 | textStyle.fontSizeValue: 8.0 48 | bottomMargin: 5.0 49 | textStyle.fontFamily: 'Slate Pro' 50 | textStyle.fontSize: FontSize.Large 51 | textStyle.fontWeight: FontWeight.W500 52 | } 53 | Label { 54 | id: handle 55 | text: "@" + ListItemData.user.screen_name 56 | textStyle.fontSizeValue: 8.0 57 | //textStyle.color: Color.create("#454545") 58 | textStyle.color: Color.create("#7A7A7A") 59 | topMargin: 0.0 60 | textStyle.fontFamily: 'Slate Pro' 61 | textStyle.fontSize: FontSize.PointValue 62 | 63 | //textStyle.fontSize: FontSize.Large 64 | } 65 | 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Bird10/assets/components/TweetComponentMain.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | import com.pipacs.o2 1.0 22 | import bb.system 1.2 23 | import org.labsquare 1.0 24 | import bb.multimedia 1.4 25 | 26 | ListItemComponent { 27 | id: lic 28 | type: "main" 29 | 30 | BaseTweetContainer { 31 | gestureHandlers: [] // we don't want to open another conversation identical to the current one when the user taps the main tweet 32 | 33 | id: itemRoot 34 | 35 | layout: StackLayout { 36 | orientation: LayoutOrientation.TopToBottom 37 | } 38 | 39 | topPadding: 10.0 40 | leftPadding: 20 41 | rightPadding: 20.0 42 | bottomPadding: 15 43 | 44 | TweetAuthorMain { 45 | } 46 | 47 | Label { 48 | text: ListItemData.full_text 49 | multiline: true 50 | textFormat: TextFormat.Html 51 | textStyle.fontFamily: 'Slate Pro' 52 | //topMargin: 10 53 | horizontalAlignment: HorizontalAlignment.Fill 54 | textStyle.fontSize: FontSize.PointValue 55 | textStyle.fontSizeValue: 7.5 56 | content.flags: TextContentFlag.ActiveText | TextContentFlag.Emoticons 57 | textStyle.base: itemRoot.ListItem.view.twemojiStyle 58 | activeTextHandler: TweetTextHandler { 59 | } 60 | } 61 | 62 | CardComponent { 63 | } 64 | Container { 65 | visible: ! ListItemData.is_quote_status 66 | maxHeight: 10 67 | minHeight: 10 68 | } 69 | 70 | QuotedTweetComponent { 71 | visible: delegateActive 72 | delegateActive: ListItemData.is_quote_status 73 | } 74 | 75 | TweetActionBarMain{ 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /Bird10/assets/components/TweetHeader.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | Container { 23 | layout: StackLayout { 24 | orientation: LayoutOrientation.LeftToRight 25 | } 26 | 27 | Container { 28 | layout: StackLayout { 29 | orientation: LayoutOrientation.LeftToRight 30 | } 31 | 32 | Label { 33 | id: username 34 | text: ListItemData.user.name 35 | textStyle.fontWeight: FontWeight.Bold 36 | textStyle.fontSizeValue: 7.0 37 | rightMargin: 5.0 38 | textStyle.fontFamily: 'Slate Pro' 39 | 40 | } 41 | Label { 42 | id: handle 43 | text: "@" + ListItemData.user.screen_name 44 | textStyle.fontSizeValue: 7.0 45 | textStyle.color: Color.create("#7A7A7A") 46 | leftMargin: 0.0 47 | textStyle.fontFamily: 'Slate Pro' 48 | layoutProperties: StackLayoutProperties { 49 | spaceQuota: 1 50 | } 51 | } 52 | layoutProperties: StackLayoutProperties { 53 | spaceQuota: 1 54 | } 55 | } 56 | 57 | Label { 58 | id: t 59 | text: ListItemData.time 60 | textStyle.fontSizeValue: 7.0 61 | textStyle.color: Color.create("#7A7A7A") 62 | textStyle.textAlign: TextAlign.Right 63 | } 64 | 65 | 66 | } -------------------------------------------------------------------------------- /Bird10/assets/components/TweetTextHandler.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | ActiveTextHandler { 23 | onTriggered: { 24 | console.debug(event.href) 25 | if (event.href.toString().charAt(0) == "#"){ 26 | event.abort() 27 | itemRoot.ListItem.view.openHashtag(event.href.toString()) 28 | } 29 | else if (event.href.toString().charAt(0) == "@"){ 30 | event.abort() 31 | itemRoot.ListItem.view.openProfileFromScreenName(event.href.toString().substring(1)) //remove leading @ 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Bird10/assets/components/Waiter.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | Dialog { 23 | id: wait 24 | onOpened: { 25 | indicator.start(); 26 | } 27 | onClosed: { 28 | indicator.stop(); 29 | } 30 | Container { 31 | horizontalAlignment: HorizontalAlignment.Fill 32 | verticalAlignment: VerticalAlignment.Fill 33 | background: Color.create(0.0, 0.0, 0.0, 0.0) 34 | ActivityIndicator { 35 | id: indicator 36 | horizontalAlignment: HorizontalAlignment.Center 37 | verticalAlignment: VerticalAlignment.Center 38 | preferredWidth: Infinity 39 | preferredHeight: Infinity 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /Bird10/assets/components/actions/LoginAction.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | ActionItem { 23 | id: loginAction 24 | 25 | title: o1Twitter.linked ? "Logout" : "Login" 26 | imageSource: "asset:///images/logout.png" 27 | onTriggered: { 28 | enabled = false 29 | if (o1Twitter.linked) { 30 | o1Twitter.unlink() 31 | o1Legacy.unlink() 32 | } else { 33 | o1Twitter.link() 34 | } 35 | } 36 | ActionBar.placement: ActionBarPlacement.InOverflow 37 | } -------------------------------------------------------------------------------- /Bird10/assets/components/actions/PayAction.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | ActionItem { 23 | id: payAction 24 | title: "Donate" 25 | imageSource: "asset:///images/heart.png" 26 | onTriggered: { 27 | _pay.trigger("bb.action.OPEN") 28 | } 29 | attachedObjects: Invocation { 30 | id: _pay 31 | query { 32 | uri: "https://paypal.me/pools/c/8pJlhpRSa8" 33 | invokeTargetId: "sys.browser" 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Bird10/assets/components/actions/RefreshAction.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2021 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | ActionItem { 23 | id: refreshAction 24 | enabled: o1Twitter.linked 25 | title: "Refresh" 26 | imageSource: "asset:///images/ic_resume.png" 27 | ActionBar.placement: ActionBarPlacement.InOverflow 28 | } -------------------------------------------------------------------------------- /Bird10/assets/components/actions/ScrollToTop.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2021 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | 22 | ActionItem { 23 | id: scrollTop 24 | title: "Scroll to top" 25 | imageSource: "asset:///images/ic_to_top.png" 26 | onTriggered: { 27 | tweetList.scrollToItem([ 0 ]) 28 | } 29 | ActionBar.placement: ActionBarPlacement.InOverflow 30 | } -------------------------------------------------------------------------------- /Bird10/assets/fonts/Twemoji.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/fonts/Twemoji.ttf -------------------------------------------------------------------------------- /Bird10/assets/images/add_to_list_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/add_to_list_80x80.png -------------------------------------------------------------------------------- /Bird10/assets/images/bird_logo_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/bird_logo_white.png -------------------------------------------------------------------------------- /Bird10/assets/images/btn_default_photo_gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/btn_default_photo_gallery.png -------------------------------------------------------------------------------- /Bird10/assets/images/btn_emoji_flags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/btn_emoji_flags.png -------------------------------------------------------------------------------- /Bird10/assets/images/btn_emoji_food.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/btn_emoji_food.png -------------------------------------------------------------------------------- /Bird10/assets/images/btn_emoji_nature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/btn_emoji_nature.png -------------------------------------------------------------------------------- /Bird10/assets/images/btn_emoji_objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/btn_emoji_objects.png -------------------------------------------------------------------------------- /Bird10/assets/images/btn_emoji_people.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/btn_emoji_people.png -------------------------------------------------------------------------------- /Bird10/assets/images/btn_emoji_places.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/btn_emoji_places.png -------------------------------------------------------------------------------- /Bird10/assets/images/btn_emoji_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/btn_emoji_square.png -------------------------------------------------------------------------------- /Bird10/assets/images/btn_emoji_symbols.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/btn_emoji_symbols.png -------------------------------------------------------------------------------- /Bird10/assets/images/btn_pressed_photo_gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/btn_pressed_photo_gallery.png -------------------------------------------------------------------------------- /Bird10/assets/images/bubble_arrow_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/bubble_arrow_blue.png -------------------------------------------------------------------------------- /Bird10/assets/images/bubble_arrow_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/bubble_arrow_gray.png -------------------------------------------------------------------------------- /Bird10/assets/images/card_null.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/card_null.png -------------------------------------------------------------------------------- /Bird10/assets/images/chat_bubble_blue.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "chat_bubble_blue.png" 3 | sliceMargins: 16 16 16 16 -------------------------------------------------------------------------------- /Bird10/assets/images/chat_bubble_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/chat_bubble_blue.png -------------------------------------------------------------------------------- /Bird10/assets/images/chat_bubble_gray.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "chat_bubble_gray.png" 3 | sliceMargins: 16 16 16 16 -------------------------------------------------------------------------------- /Bird10/assets/images/chat_bubble_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/chat_bubble_gray.png -------------------------------------------------------------------------------- /Bird10/assets/images/default_profile_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/default_profile_image.png -------------------------------------------------------------------------------- /Bird10/assets/images/delete_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/delete_80x80.png -------------------------------------------------------------------------------- /Bird10/assets/images/emoji_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Bird10/assets/images/fleet_gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/fleet_gradient.png -------------------------------------------------------------------------------- /Bird10/assets/images/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/heart.png -------------------------------------------------------------------------------- /Bird10/assets/images/heart_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/heart_grey.png -------------------------------------------------------------------------------- /Bird10/assets/images/heart_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/heart_red.png -------------------------------------------------------------------------------- /Bird10/assets/images/home_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/home_80x80.png -------------------------------------------------------------------------------- /Bird10/assets/images/ic_collapse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/ic_collapse.png -------------------------------------------------------------------------------- /Bird10/assets/images/ic_doctype_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/ic_doctype_video.png -------------------------------------------------------------------------------- /Bird10/assets/images/ic_done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/ic_done.png -------------------------------------------------------------------------------- /Bird10/assets/images/ic_done_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/ic_done_black.png -------------------------------------------------------------------------------- /Bird10/assets/images/ic_expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/ic_expand.png -------------------------------------------------------------------------------- /Bird10/assets/images/ic_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/ic_open.png -------------------------------------------------------------------------------- /Bird10/assets/images/ic_resume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/ic_resume.png -------------------------------------------------------------------------------- /Bird10/assets/images/ic_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/ic_save.png -------------------------------------------------------------------------------- /Bird10/assets/images/ic_to_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/ic_to_top.png -------------------------------------------------------------------------------- /Bird10/assets/images/icn_compose_focused_100x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/icn_compose_focused_100x100.png -------------------------------------------------------------------------------- /Bird10/assets/images/icn_compose_white_100x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/icn_compose_white_100x100.png -------------------------------------------------------------------------------- /Bird10/assets/images/icn_search_focused_100x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/icn_search_focused_100x100.png -------------------------------------------------------------------------------- /Bird10/assets/images/icn_search_white_100x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/icn_search_white_100x100.png -------------------------------------------------------------------------------- /Bird10/assets/images/image_mask.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "image_mask.png" 3 | sliceMargins: 16 16 16 16 -------------------------------------------------------------------------------- /Bird10/assets/images/image_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/image_mask.png -------------------------------------------------------------------------------- /Bird10/assets/images/image_mask_dark.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "image_mask_dark.png" 3 | sliceMargins: 16 16 16 16 4 | -------------------------------------------------------------------------------- /Bird10/assets/images/image_mask_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/image_mask_dark.png -------------------------------------------------------------------------------- /Bird10/assets/images/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/link.png -------------------------------------------------------------------------------- /Bird10/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/logo.png -------------------------------------------------------------------------------- /Bird10/assets/images/logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/logout.png -------------------------------------------------------------------------------- /Bird10/assets/images/mail_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/mail_80x80.png -------------------------------------------------------------------------------- /Bird10/assets/images/me_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/me_80x80.png -------------------------------------------------------------------------------- /Bird10/assets/images/messages_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/messages_80x80.png -------------------------------------------------------------------------------- /Bird10/assets/images/new_msg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/new_msg.png -------------------------------------------------------------------------------- /Bird10/assets/images/notifications_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/notifications_80x80.png -------------------------------------------------------------------------------- /Bird10/assets/images/notifications_active_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/notifications_active_80x80.png -------------------------------------------------------------------------------- /Bird10/assets/images/play-50x50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/play-50x50.png -------------------------------------------------------------------------------- /Bird10/assets/images/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/play.png -------------------------------------------------------------------------------- /Bird10/assets/images/poll_button.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "poll_button.png" 3 | sliceMargins: 3 3 3 3 -------------------------------------------------------------------------------- /Bird10/assets/images/poll_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/poll_button.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/avatar_border.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "avatar_border.png" 3 | sliceMargins: 13 65 13 65 -------------------------------------------------------------------------------- /Bird10/assets/images/profile/avatar_border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/avatar_border.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/dark_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/dark_background.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/follow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/follow.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/icn_lock_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/icn_lock_sm.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/list_item_chevron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/list_item_chevron.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/profile_pic_gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/profile_pic_gradient.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/profile_position-gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/profile_position-gray.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/profile_position-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/profile_position-white.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/profile_position.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/profile_position.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/tweet_tile_bkg-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/tweet_tile_bkg-pressed.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/tweet_tile_bkg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/tweet_tile_bkg.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/tweet_tile_bkg_invers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/tweet_tile_bkg_invers.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/unfollow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/unfollow.png -------------------------------------------------------------------------------- /Bird10/assets/images/profile/verified_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/profile/verified_profile.png -------------------------------------------------------------------------------- /Bird10/assets/images/reply_hvr_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/reply_hvr_80x80.png -------------------------------------------------------------------------------- /Bird10/assets/images/reply_on_hvr_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/reply_on_hvr_80x80.png -------------------------------------------------------------------------------- /Bird10/assets/images/retweet_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/retweet_80x80.png -------------------------------------------------------------------------------- /Bird10/assets/images/retweet_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/retweet_green.png -------------------------------------------------------------------------------- /Bird10/assets/images/retweet_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/retweet_grey.png -------------------------------------------------------------------------------- /Bird10/assets/images/retweet_on_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/retweet_on_80x80.png -------------------------------------------------------------------------------- /Bird10/assets/images/rounded9slice.amd: -------------------------------------------------------------------------------- 1 | #RimCascadesAssetMetaData version=1.0 2 | source: "rounded9slice.png" 3 | sliceMargins: 18 18 18 18 -------------------------------------------------------------------------------- /Bird10/assets/images/rounded9slice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/rounded9slice.png -------------------------------------------------------------------------------- /Bird10/assets/images/search_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/search_cancel.png -------------------------------------------------------------------------------- /Bird10/assets/images/share_tweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/share_tweet.png -------------------------------------------------------------------------------- /Bird10/assets/images/share_tweet_hvr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/share_tweet_hvr.png -------------------------------------------------------------------------------- /Bird10/assets/images/share_tweet_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/share_tweet_white.png -------------------------------------------------------------------------------- /Bird10/assets/images/twitterheart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/assets/images/twitterheart.png -------------------------------------------------------------------------------- /Bird10/assets/user.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | import bb.cascades 1.4 21 | import com.pipacs.o2 1.0 22 | import bb.system 1.2 23 | import org.labsquare 1.0 24 | 25 | NavigationPane { 26 | id: nav 27 | peekEnabled: true 28 | 29 | onCreationCompleted: { 30 | if (o1Twitter.linked) 31 | twitterApi.requestProfileTweets() 32 | else 33 | loginSheet.open() 34 | //loginAction.triggered() 35 | } 36 | 37 | function error_message(text){ 38 | errorToast.body = text 39 | errorToast.show() 40 | } 41 | 42 | UserProfile { 43 | onCreationCompleted: { 44 | setUser(o1Twitter.extraTokens.screen_name) //Self profile name 45 | } 46 | } 47 | 48 | attachedObjects: [ 49 | ComponentDefinition { 50 | id: tweetSheetDefinition 51 | content: TweetSheet { 52 | } 53 | }, 54 | Delegate { 55 | id: tweetSheet 56 | active: false 57 | sourceComponent: tweetSheetDefinition 58 | 59 | } 60 | ] 61 | onPopTransitionEnded: { 62 | page.destroy(); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /Bird10/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10/icon.png -------------------------------------------------------------------------------- /Bird10/precompiled.h: -------------------------------------------------------------------------------- 1 | // This file is used to store precompiled headers. 2 | 3 | #include 4 | #include 5 | #include 6 | -------------------------------------------------------------------------------- /Bird10/src/Conversation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | using namespace bb::cascades; 24 | 25 | Conversation::Conversation(bool insertSpinner, QObject *parent) : QObject(parent) 26 | { 27 | m_messageModel = new GroupDataModel(QStringList() << "time", this); 28 | m_messageModel->setSortedAscending(false); 29 | m_messageModel->setGrouping(ItemGrouping::None); 30 | 31 | if(insertSpinner){ 32 | QVariantMap spinner; 33 | spinner["time"] = 0; // placed as oldest entry 34 | m_messageModel->insert(spinner); 35 | } 36 | } 37 | 38 | Conversation::~Conversation() 39 | { 40 | delete m_messageModel; 41 | } 42 | 43 | void Conversation::insertMessage(const QVariantMap& message) 44 | { 45 | m_messageModel->insert(message); 46 | 47 | emit messageModelChanged(); 48 | } 49 | -------------------------------------------------------------------------------- /Bird10/src/Conversation.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef CONVERSATION_HPP_ 21 | #define CONVERSATION_HPP_ 22 | 23 | #include 24 | #include 25 | 26 | class Conversation: public QObject 27 | { 28 | Q_OBJECT 29 | public: 30 | 31 | Q_PROPERTY(QVariantMap previewData READ previewData WRITE setPreviewData NOTIFY previewDataChanged FINAL) 32 | inline QVariantMap previewData(){ return m_previewData; }; 33 | inline void setPreviewData(const QVariantMap& previewData){ m_previewData = previewData; emit previewDataChanged(); }; 34 | 35 | Q_PROPERTY(bb::cascades::GroupDataModel* messageModel READ messageModel NOTIFY messageModelChanged FINAL) 36 | inline bb::cascades::GroupDataModel* messageModel(){ return m_messageModel; }; 37 | 38 | // shortcut to time field of previewData, needed by the inbox GroupDataModel pointing to the conversation for ordering 39 | Q_PROPERTY(qulonglong time READ time NOTIFY previewDataChanged FINAL) 40 | inline qulonglong time(){ return m_previewData["time"].toULongLong(); }; 41 | 42 | 43 | Conversation(bool insertSpinner = true, QObject *parent = 0); 44 | ~Conversation(); 45 | 46 | void insertMessage(const QVariantMap& message); 47 | 48 | 49 | signals: 50 | void previewDataChanged(); 51 | void messageModelChanged(); 52 | 53 | private: 54 | bb::cascades::GroupDataModel* m_messageModel; 55 | QVariantMap m_previewData; 56 | }; 57 | 58 | Q_DECLARE_METATYPE(Conversation*) 59 | 60 | #endif /* CONVERSATION_HPP_ */ 61 | -------------------------------------------------------------------------------- /Bird10/src/ConversationApi.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef CONVERSATIONAPI_HPP_ 21 | #define CONVERSATIONAPI_HPP_ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | class ConversationApi: public TwitterApi 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | 34 | ConversationApi(QObject *parent = 0); 35 | 36 | Q_INVOKABLE void loadConversation(const QString& id, bool includeCursor = false); 37 | Q_INVOKABLE void loadMore(); 38 | 39 | signals: 40 | void conversationLoaded(int index); 41 | 42 | private: 43 | 44 | void insertTweet(const QVariantMap& tweet); 45 | void insertTweetsFromThread(const QVariantMap& thread); 46 | 47 | private slots: 48 | 49 | void conversationReceived(); 50 | 51 | private: 52 | QVariantMap m_tweets; 53 | QVariantMap m_users; 54 | QString m_id, m_cursor; 55 | int m_tweetsCount; 56 | int m_mainTweetIndex; 57 | }; 58 | 59 | #endif /* CONVERSATIONAPI_HPP_ */ 60 | -------------------------------------------------------------------------------- /Bird10/src/DiscoverApi.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef DISCOVERAPI_HPP_ 21 | #define DISCOVERAPI_HPP_ 22 | 23 | 24 | #include 25 | 26 | class DiscoverApi: public TwitterApi 27 | { 28 | Q_OBJECT 29 | public: 30 | 31 | DiscoverApi(QObject* parent = 0); 32 | virtual ~DiscoverApi(); 33 | 34 | Q_INVOKABLE void requestSearch(const QString& query, const QString& filter = QString(), const QString& cursorBottom = QString()); 35 | Q_INVOKABLE void requestOlderTweets(); 36 | 37 | protected slots: 38 | 39 | void onSearchReceived(); 40 | 41 | 42 | protected: 43 | 44 | void insertTweet(const QVariantMap& tweet); 45 | 46 | protected: 47 | 48 | QVariantMap m_users, m_tweets; 49 | QString m_query, m_filter, m_cursorBottom; 50 | }; 51 | 52 | #endif /* DISCOVERAPI_HPP_ */ 53 | -------------------------------------------------------------------------------- /Bird10/src/FleetApi.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef FLEETAPI_HPP_ 21 | #define FLEETAPI_HPP_ 22 | 23 | #include "TwitterApiBase.hpp" 24 | #include 25 | 26 | using namespace bb::cascades; 27 | 28 | class FleetApi: public TwitterApiBase 29 | { 30 | Q_OBJECT 31 | 32 | Q_PROPERTY(bb::cascades::ArrayDataModel* fleetThreads READ fleetThreads CONSTANT) 33 | ArrayDataModel* fleetThreads(){return m_fleetThreads;}; 34 | 35 | Q_PROPERTY(bool allRead READ allRead NOTIFY allReadChanged) 36 | bool allRead(){return m_allRead;}; 37 | 38 | public: 39 | FleetApi(QObject* parent = 0); 40 | 41 | Q_INVOKABLE void requestFleets(); 42 | Q_INVOKABLE void markRead(const QString& fleet_thread_id, const QStringList& ids); 43 | Q_INVOKABLE void markRead(const QString& id); 44 | // Q_INVOKABLE void preloadFleetThread(int indexPath); 45 | 46 | signals: 47 | void fleetsLoaded(); 48 | void allReadChanged(); 49 | 50 | protected slots: 51 | void onFleetsReceived(); 52 | void onUserInfo(); 53 | 54 | protected: 55 | void parseFleets(const QVariantList& threads); 56 | void requestUserInfo(int thread_index); 57 | 58 | 59 | protected: 60 | ArrayDataModel* m_fleetThreads; 61 | QVariantList m_threads; 62 | int m_fleetsParsed; 63 | bool m_allRead; 64 | }; 65 | 66 | #endif /* FLEETAPI_HPP_ */ 67 | -------------------------------------------------------------------------------- /Bird10/src/ListApi.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef LISTAPI_HPP_ 21 | #define LISTAPI_HPP_ 22 | 23 | #include "twitterapi.hpp" 24 | 25 | class ListApi: public TwitterApi 26 | { 27 | Q_OBJECT 28 | public: 29 | /// List of lists (no pun intended) 30 | Q_PROPERTY(bb::cascades::ArrayDataModel *listsModel READ listsModel NOTIFY listsModelChanged) 31 | inline bb::cascades::ArrayDataModel *listsModel(){ return m_listsModel; }; 32 | 33 | Q_PROPERTY(QString listId READ listId WRITE setListId NOTIFY listIdChanged) 34 | inline QString listId(){ return m_listId; }; 35 | inline void setListId(QString listId){ m_listId = listId; emit listIdChanged(); }; 36 | 37 | ListApi(QObject* parent = 0); 38 | 39 | Q_INVOKABLE void requestTweets(Direction dir = NONE); 40 | 41 | Q_INVOKABLE void requestLists(); 42 | 43 | signals: 44 | void listsModelChanged(); 45 | void listIdChanged(); 46 | 47 | protected slots: 48 | void onLists(); 49 | 50 | protected: 51 | bb::cascades::ArrayDataModel* m_listsModel; 52 | QString m_listId; 53 | }; 54 | 55 | #endif /* LISTAPI_HPP_ */ 56 | -------------------------------------------------------------------------------- /Bird10/src/MediaUploader.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef MEDIAUPLOADER_HPP_ 21 | #define MEDIAUPLOADER_HPP_ 22 | 23 | #include 24 | #include 25 | #include 26 | #include "TwitterApiBase.hpp" 27 | 28 | class MediaUploader : public TwitterApiBase 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | enum MediaType{ 34 | IMAGE, 35 | VIDEO, 36 | GIF 37 | }; 38 | enum MediaContext{ 39 | TWEET, 40 | DM 41 | }; 42 | 43 | MediaUploader(O1Twitter* authenticator, QObject* parent = 0); 44 | 45 | void setMediaContext(MediaContext context){m_mediaContext = context;}; 46 | void uploadVideo(const QString& path); 47 | void uploadPictures(const QList& paths); 48 | 49 | signals: 50 | void uploadComplete(QString media_ids); 51 | 52 | protected: 53 | void uploadPicture(const QString& path); 54 | 55 | protected slots: 56 | void append(); 57 | void finalize(); 58 | void checkStatus(); 59 | void status(); 60 | void onImageUploadSucceeded(); 61 | 62 | protected: 63 | MediaType m_mediaType; 64 | MediaContext m_mediaContext; 65 | QString m_id; 66 | QFile m_currentFile; 67 | int m_index; 68 | QStringList m_mediaIds, m_paths; 69 | }; 70 | 71 | #endif /* MEDIAUPLOADER_HPP_ */ 72 | -------------------------------------------------------------------------------- /Bird10/src/NotificationsApi.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef NOTIFICATIONSAPI_HPP_ 21 | #define NOTIFICATIONSAPI_HPP_ 22 | 23 | #include "TwitterApiBase.hpp" 24 | #include 25 | 26 | class NotificationsApi: public TwitterApiBase 27 | { 28 | Q_OBJECT 29 | public: 30 | Q_PROPERTY(bb::cascades::ArrayDataModel* notifications READ notifications NOTIFY notificationModelChanged) 31 | inline bb::cascades::ArrayDataModel* notifications(){ return m_notificationModel; }; 32 | 33 | Q_PROPERTY(int unreadCount READ unreadCount NOTIFY unreadCountChanged) 34 | inline int unreadCount(){ return m_unreadCount; }; 35 | // inline void setUnreadCount(int count){ m_unreadCount = count; emit unreadCountChanged(); }; 36 | 37 | NotificationsApi(QObject *parent = 0); 38 | 39 | Q_INVOKABLE void requestNotifications(); 40 | Q_INVOKABLE void updateUnreadIndex(); 41 | Q_INVOKABLE void clearNotifications(); 42 | 43 | 44 | signals: 45 | void notificationModelChanged(); 46 | void unreadCountChanged(); 47 | 48 | private slots: 49 | void onNotificationsReceived(); 50 | 51 | private: 52 | int insertNotification(const QString& n, int pos, const QString& sortIndex); 53 | int insertTweet(const QString& id, int pos, const QString& sortIndex); 54 | 55 | private: 56 | QString m_cursor, m_unreadIndex; 57 | bb::cascades::ArrayDataModel* m_notificationModel; 58 | QVariantMap m_notifications, m_tweets, m_users; 59 | int m_unreadCount; 60 | }; 61 | 62 | #endif /* NOTIFICATIONSAPI_HPP_ */ 63 | -------------------------------------------------------------------------------- /Bird10/src/QJson4/QJsonParseError.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 - 2016 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include "QJsonParseError.h" 20 | 21 | #if QT_VERSION < 0x050000 22 | 23 | //------------------------------------------------------------------------------ 24 | // Name: errorString 25 | // Desc: The QJsonParseError class is used to report errors during JSON parsing. 26 | //------------------------------------------------------------------------------ 27 | QString QJsonParseError::errorString() const { 28 | switch(error) { 29 | case NoError: 30 | return "No error occurred"; 31 | case UnterminatedObject: 32 | return "unterminated object"; 33 | case MissingNameSeparator: 34 | return "missing name separator"; 35 | case UnterminatedArray: 36 | return "unterminated array"; 37 | case MissingValueSeparator: 38 | return "missing value separator"; 39 | case IllegalValue: 40 | return "illegal value"; 41 | case TerminationByNumber: 42 | return "invalid termination by number"; 43 | case IllegalNumber: 44 | return "illegal number"; 45 | case IllegalEscapeSequence: 46 | return "illegal escape sequence"; 47 | case IllegalUTF8String: 48 | return "invalid UTF8 string"; 49 | case UnterminatedString: 50 | return "unterminated string"; 51 | case MissingObject: 52 | return "object is missing after a comma"; 53 | case DeepNesting: 54 | return "too deeply nested document"; 55 | case DocumentTooLarge: 56 | return "too large document"; 57 | case GarbageAtEnd: 58 | return "garbage at the end of the document"; 59 | } 60 | 61 | return QString(); 62 | } 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Bird10/src/QJson4/QJsonParseError.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 - 2016 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef QJSON_PARSE_ERROR_H_ 20 | #define QJSON_PARSE_ERROR_H_ 21 | 22 | #include 23 | 24 | #if QT_VERSION >= 0x050000 25 | #include 26 | #else 27 | 28 | #include 29 | 30 | class QJsonParseError { 31 | public: 32 | enum ParseError { 33 | NoError = 0, 34 | UnterminatedObject = 1, 35 | MissingNameSeparator = 2, 36 | UnterminatedArray = 3, 37 | MissingValueSeparator = 4, 38 | IllegalValue = 5, 39 | TerminationByNumber = 6, 40 | IllegalNumber = 7, 41 | IllegalEscapeSequence = 8, 42 | IllegalUTF8String = 9, 43 | UnterminatedString = 10, 44 | MissingObject = 11, 45 | DeepNesting = 12, 46 | DocumentTooLarge = 13, 47 | GarbageAtEnd = 14 48 | }; 49 | 50 | public: 51 | QString errorString() const; 52 | 53 | public: 54 | ParseError error; 55 | int offset; 56 | }; 57 | 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Bird10/src/QJson4/QJsonParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 - 2016 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | // NOTE: this is not part of the "public" Qt API, so using this class directly 20 | // is not recomended 21 | 22 | #ifndef QJSON_PARSER_H_ 23 | #define QJSON_PARSER_H_ 24 | 25 | #include 26 | 27 | #if QT_VERSION < 0x050000 28 | 29 | #include "QJsonParseError.h" 30 | #include 31 | class QJsonRoot; 32 | class QJsonObject; 33 | class QJsonArray; 34 | class QJsonValue; 35 | 36 | class QJsonParser { 37 | friend class QJsonDocument; 38 | 39 | public: 40 | QJsonParser(const char *begin, const char *end); 41 | 42 | public: 43 | QJsonRoot *parse(); 44 | 45 | public: 46 | QJsonParseError state() const; 47 | 48 | private: 49 | static const char ArrayBegin = '['; 50 | static const char ArrayEnd = ']'; 51 | static const char NameSeparator = ':'; 52 | static const char ValueSeparator = ','; 53 | static const char ObjectBegin = '{'; 54 | static const char ObjectEnd = '}'; 55 | static const char Quote = '"'; 56 | 57 | private: 58 | char peek(); 59 | QJsonObject *getObject(); 60 | QJsonArray *getArray(); 61 | QJsonValue getValue(); 62 | QString getString(); 63 | QJsonValue getTrue(); 64 | QJsonValue getFalse(); 65 | QJsonValue getNull(); 66 | QJsonValue getNumber(); 67 | QPair getPair(); 68 | 69 | private: 70 | void throwError(QJsonParseError::ParseError e); 71 | 72 | private: 73 | QJsonParseError state_; 74 | const char *const begin_; 75 | const char *const end_; 76 | const char * p_; 77 | }; 78 | 79 | #endif 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /Bird10/src/QJson4/QJsonRoot.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 - 2016 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | // NOTE: this is not part of the "public" Qt API, so using this class directly 20 | // is not recomended 21 | 22 | #ifndef QJSON_ROOT_H_ 23 | #define QJSON_ROOT_H_ 24 | 25 | #include 26 | 27 | #if QT_VERSION < 0x050000 28 | 29 | class QJsonObject; 30 | class QJsonArray; 31 | 32 | class QJsonRoot { 33 | public: 34 | virtual ~QJsonRoot() {}; 35 | 36 | public: 37 | virtual QJsonRoot *clone() const = 0; 38 | 39 | public: 40 | virtual QJsonArray *toArray() = 0; 41 | virtual QJsonObject *toObject() = 0; 42 | virtual const QJsonArray *toArray() const = 0; 43 | virtual const QJsonObject *toObject() const = 0; 44 | }; 45 | 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Bird10/src/QJson4/QJsonValueRef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 - 2016 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef QJSON_VALUEREF_H_ 20 | #define QJSON_VALUEREF_H_ 21 | 22 | #include 23 | 24 | #if QT_VERSION >= 0x050000 25 | #include 26 | #else 27 | 28 | #include "QJsonValue.h" 29 | class QJsonRoot; 30 | 31 | class QJsonValueRef { 32 | public: 33 | QJsonValueRef(QJsonArray *array, int idx); 34 | 35 | // slight variant from official APIs implementation 36 | QJsonValueRef(QJsonObject *object, const QString &key); 37 | 38 | public: 39 | operator QJsonValue() const; 40 | 41 | public: 42 | QJsonValueRef &operator=(const QJsonValue &val); 43 | QJsonValueRef &operator=(const QJsonValueRef &val); 44 | 45 | public: 46 | QJsonValue::Type type() const; 47 | bool isNull() const; 48 | bool isBool() const; 49 | bool isDouble() const; 50 | bool isString() const; 51 | bool isArray() const; 52 | bool isObject() const; 53 | bool isUndefined() const; 54 | 55 | public: 56 | bool toBool() const; 57 | double toDouble() const; 58 | QString toString() const; 59 | QJsonArray toArray() const; 60 | QJsonObject toObject() const; 61 | int toInt(int defaultValue = 0) const; 62 | 63 | public: 64 | bool operator==(const QJsonValue &other) const; 65 | bool operator!=(const QJsonValue &other) const; 66 | 67 | private: 68 | QJsonValue toValue() const; 69 | void swap(QJsonValueRef &other); 70 | 71 | private: 72 | QJsonRoot *p_; 73 | int index_; 74 | QString key_; 75 | }; 76 | 77 | #endif 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /Bird10/src/QtCurl/CurlMulti.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef CURLMULTI_H 21 | #define CURLMULTI_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | class QTimer; 29 | class CurlEasy; 30 | struct CurlMultiSocket; 31 | 32 | class CurlMulti : public QObject 33 | { 34 | Q_OBJECT 35 | public: 36 | explicit CurlMulti(QObject *parent = 0); 37 | virtual ~CurlMulti(); 38 | 39 | static CurlMulti* threadInstance(); 40 | 41 | void addTransfer(CurlEasy *transfer); 42 | void removeTransfer(CurlEasy *transfer); 43 | 44 | protected slots: 45 | void curlMultiPerform(); 46 | void curlMultiTimeout(); 47 | void socketReadyRead(int socketDescriptor); 48 | void socketReadyWrite(int socketDescriptor); 49 | void socketException(int socketDescriptor); 50 | 51 | protected: 52 | void curlSocketAction(curl_socket_t socketDescriptor, int eventsBitmask); 53 | int curlTimerFunction(int timeoutMsec); 54 | int curlSocketFunction(CURL *easyHandle, curl_socket_t socketDescriptor, int action, CurlMultiSocket *socket); 55 | static int staticCurlTimerFunction(CURLM *multiHandle, long timeoutMs, void *userp); 56 | static int staticCurlSocketFunction(CURL *easyHandle, curl_socket_t socketDescriptor, int what, void *userp, void *sockp); 57 | 58 | CURLM *handle_; 59 | int running_; 60 | 61 | int newerTimerExists, lastTimerHandled, counter; 62 | QMutex* mutex; 63 | 64 | QSet transfers_; 65 | }; 66 | 67 | #endif // CURLMULTIINTERFACE_H 68 | -------------------------------------------------------------------------------- /Bird10/src/RetweetDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | 22 | 23 | RetweetDialog::RetweetDialog() : SystemDialog("Quote tweet", "Retweet", "Cancel"){ 24 | //SystemDialog("Retweet", "Quote tweet", "Cancel"); 25 | setTitle("Select an action"); 26 | connect(this, SIGNAL(finished(bb::system::SystemUiResult::Type)), this, SLOT(onFinished(bb::system::SystemUiResult::Type))); 27 | } 28 | 29 | void RetweetDialog::open(int indexPath){ 30 | m_indexPath = indexPath; 31 | 32 | show(); 33 | } 34 | 35 | void RetweetDialog::onFinished(bb::system::SystemUiResult::Type value){ 36 | if(value == bb::system::SystemUiResult::ConfirmButtonSelection) 37 | emit quote(m_indexPath); 38 | else if(value == bb::system::SystemUiResult::CustomButtonSelection) 39 | emit retweet(m_indexPath); 40 | // else if(value == bb::system::SystemUiResult::CancelButtonSelection) 41 | // this->deleteLater(); 42 | } 43 | -------------------------------------------------------------------------------- /Bird10/src/RetweetDialog.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | 21 | #ifndef RETWEETDIALOG_HPP_ 22 | #define RETWEETDIALOG_HPP_ 23 | 24 | #include 25 | #include 26 | 27 | class RetweetDialog: public bb::system::SystemDialog{ 28 | Q_OBJECT 29 | 30 | public: 31 | // Q_PROPERTY(QVariantMap tweet READ tweet) 32 | // inline QVariantMap tweet() {return m_tweet;} 33 | 34 | RetweetDialog(); 35 | Q_INVOKABLE void open(int indexPath); 36 | 37 | Q_SIGNALS: 38 | void retweet(int indexPath); 39 | void quote(int indexPath); 40 | 41 | private Q_SLOTS: 42 | void onFinished(bb::system::SystemUiResult::Type value); 43 | 44 | private: 45 | int m_indexPath; 46 | }; 47 | 48 | #endif /* RETWEETDIALOG_HPP_ */ 49 | -------------------------------------------------------------------------------- /Bird10/src/SearchApi.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef SEARCHAPI_HPP_ 21 | #define SEARCHAPI_HPP_ 22 | 23 | #include "TwitterApiBase.hpp" 24 | #include 25 | 26 | class SearchApi: public TwitterApiBase 27 | { 28 | Q_OBJECT 29 | public: 30 | 31 | Q_PROPERTY( bb::cascades::ArrayDataModel* trends READ getTrends RESET clearTrends NOTIFY trendListChanged ) 32 | bb::cascades::ArrayDataModel* getTrends(){ return m_trends; } ; 33 | Q_INVOKABLE void clearTrends(){ m_trends->clear(); emit trendListChanged(); } ; 34 | 35 | Q_PROPERTY( bb::cascades::ArrayDataModel* users READ getUsers RESET clearUsers NOTIFY userListChanged ) 36 | bb::cascades::ArrayDataModel* getUsers(){ return m_users; } ; 37 | Q_INVOKABLE void clearUsers(){ m_users->clear(); emit userListChanged(); } ; 38 | 39 | SearchApi(QObject* parent = 0); 40 | virtual ~SearchApi(); 41 | 42 | Q_INVOKABLE void requestTrends(); 43 | Q_INVOKABLE void searchUser(const QString& text); 44 | Q_INVOKABLE void searchTopic(const QString& text); 45 | 46 | protected slots: 47 | 48 | void onTrendsReceived(); 49 | void onUserSearchReceived(); 50 | void onTopicSearchReceived(); 51 | 52 | signals: 53 | 54 | void trendListChanged(); 55 | void userListChanged(); 56 | 57 | protected: 58 | 59 | void insertTrends(const QVariantMap& trends); 60 | 61 | protected: 62 | 63 | bb::cascades::ArrayDataModel* m_trends, * m_users; 64 | }; 65 | 66 | #endif /* SEARCHAPI_HPP_ */ 67 | -------------------------------------------------------------------------------- /Bird10/src/TimelineBase.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef TIMELINEBASE_HPP_ 21 | #define TIMELINEBASE_HPP_ 22 | 23 | #include "TwitterApiBase.hpp" 24 | #include 25 | 26 | class TimelineBase: public TwitterApiBase 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | TimelineBase(QObject *parent = 0); 32 | virtual ~TimelineBase(); 33 | 34 | protected: 35 | 36 | QVariantMap parseTweet(QVariantMap tweet); 37 | QJsonObject realTweet(QJsonObject tweet); 38 | QVariantMap realTweet(QVariantMap tweet); 39 | QVariantMap realTweetV2(const QVariantMap& tweet, const QVariantMap& tweets, const QVariantMap& users); 40 | QVariantMap parseTweetV2(QVariantMap tweet, const QVariantMap& tweets, const QVariantMap& users); 41 | void rewriteUrls(std::wstring& text, const QVariantList& urls); 42 | }; 43 | 44 | #endif /* TIMELINEBASE_HPP_ */ 45 | -------------------------------------------------------------------------------- /Bird10/src/TimelineDataModel.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef TIMELINEDATAMODEL_HPP_ 21 | #define TIMELINEDATAMODEL_HPP_ 22 | 23 | #include 24 | 25 | class TimelineDataModel: public bb::cascades::ArrayDataModel 26 | { 27 | Q_OBJECT 28 | 29 | public: 30 | TimelineDataModel(QObject* parent = 0); 31 | 32 | void refreshElapsedTime(); 33 | void replaceById(const QString& id, const QVariantMap& newData); 34 | void removeById(const QString& id); 35 | void updateCard(const QString& url, const QVariantMap& newData); 36 | 37 | 38 | // Getters and Setters - nothing interesting 39 | const QString& cursorBottom() const; 40 | void setCursorBottom(const QString& cursorBottom); 41 | const QString& cursorTop() const; 42 | void setCursorTop(const QString& cursorTop); 43 | bool isTerminateBottom() const; 44 | void setTerminateBottom(bool terminateBottom); 45 | bool isTerminateTop() const; 46 | void setTerminateTop(bool terminateTop); 47 | 48 | signals: 49 | void cardUpdated(int indexPath); 50 | 51 | public slots: 52 | void clear(); 53 | 54 | 55 | protected: 56 | bool m_terminateBottom, m_terminateTop; 57 | QString m_cursorTop, m_cursorBottom; 58 | 59 | protected: 60 | QString getTimeString(const QDateTime& dt); 61 | QString getFullTimeString(const QDateTime& dt); 62 | 63 | }; 64 | 65 | #endif /* TIMELINEDATAMODEL_HPP_ */ 66 | -------------------------------------------------------------------------------- /Bird10/src/Timer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | #define TICK_TIME 16 // The screen doesn't update faster than 60 fps, don't check more times in a single frame.. 27 | 28 | Timer::Timer(QObject* parent) : QObject(parent) 29 | { 30 | } 31 | 32 | void Timer::start() 33 | { 34 | m_endTime = QDateTime::currentMSecsSinceEpoch() + m_duration; 35 | m_progress = 0; 36 | m_state = STARTED; 37 | QTimer::singleShot(TICK_TIME, this, SLOT(onTick())); 38 | emit activeChanged(); 39 | } 40 | 41 | void Timer::stop() 42 | { 43 | m_state = STOPPED; 44 | emit activeChanged(); 45 | } 46 | 47 | void Timer::pause() 48 | { 49 | m_state = PAUSED; 50 | m_remainingTime = m_endTime - QDateTime::currentMSecsSinceEpoch(); 51 | } 52 | 53 | void Timer::resume() 54 | { 55 | if(m_state == PAUSED){ 56 | m_endTime = QDateTime::currentMSecsSinceEpoch() + m_remainingTime; 57 | m_state = STARTED; 58 | QTimer::singleShot(TICK_TIME, this, SLOT(onTick())); 59 | } 60 | } 61 | 62 | void Timer::onTick() 63 | { 64 | if(m_state == STARTED){ 65 | qint64 currentTime = QDateTime::currentMSecsSinceEpoch(); 66 | m_progress = 1 - (m_endTime - currentTime)/(float)m_duration; 67 | emit progressChanged(); 68 | 69 | if(currentTime >= m_endTime){ 70 | stop(); 71 | emit triggered(); 72 | } 73 | else 74 | QTimer::singleShot(TICK_TIME, this, SLOT(onTick())); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Bird10/src/Timer.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef TIMER_HPP_ 21 | #define TIMER_HPP_ 22 | 23 | #include 24 | 25 | class Timer: public QObject 26 | { 27 | Q_OBJECT 28 | 29 | typedef enum{ 30 | STOPPED, 31 | STARTED, 32 | PAUSED, 33 | } TimerState; 34 | 35 | public: 36 | 37 | Q_PROPERTY(int duration READ duration WRITE setDuration) 38 | int duration(){ return m_duration;}; 39 | void setDuration(int duration){ m_duration = duration;}; 40 | 41 | Q_PROPERTY(float progress READ progress NOTIFY progressChanged) 42 | float progress(){ return m_progress;}; 43 | 44 | Q_PROPERTY(bool active READ active NOTIFY activeChanged) 45 | bool active(){ return m_state != STOPPED;}; 46 | 47 | Timer(QObject* parent = 0); 48 | 49 | signals: 50 | void triggered(); 51 | void progressChanged(); 52 | void activeChanged(); 53 | 54 | public slots: 55 | void start(); 56 | void stop(); 57 | void pause(); 58 | void resume(); 59 | 60 | protected slots: 61 | void onTick(); 62 | 63 | protected: 64 | int m_duration, m_remainingTime; 65 | float m_progress; 66 | qint64 m_endTime; 67 | TimerState m_state; 68 | 69 | }; 70 | 71 | #endif /* TIMER_HPP_ */ 72 | -------------------------------------------------------------------------------- /Bird10/src/TweetApi.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef TWEETAPI_HPP_ 21 | #define TWEETAPI_HPP_ 22 | 23 | #include "TwitterApiBase.hpp" 24 | #include 25 | 26 | class TweetApi: public TwitterApiBase{ 27 | Q_OBJECT 28 | 29 | public: 30 | TweetApi(QObject *parent = 0); 31 | 32 | Q_INVOKABLE void tweet(QString status, QString in_reply_to_status_id, QString attachment_url); 33 | Q_INVOKABLE void imageTweet(QString status, QVariantList images, QString in_reply_to_status_id, QString attachment_url); 34 | Q_INVOKABLE void videoTweet(const QString& status, const QString& video, const QString& in_reply_to_status_id, const QString& attachment_url); 35 | 36 | signals: 37 | void tweeted(); 38 | void mediaSizeError(); 39 | 40 | protected slots: 41 | void onTweeted(); 42 | void postMediaTweet(const QString& media_ids); 43 | 44 | protected: 45 | QString m_status, reply_status_id, m_attachment_url; 46 | }; 47 | 48 | #endif /* TWEETAPI_HPP_ */ 49 | -------------------------------------------------------------------------------- /Bird10/src/TwitterApiBase.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef TWITTERAPIBASE_HPP_ 21 | #define TWITTERAPIBASE_HPP_ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | class TwitterApiBase : public QObject 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | /// OAuth authenticator 33 | Q_PROPERTY(O1Twitter *authenticator READ authenticator WRITE setAuthenticator) 34 | inline O1Twitter *authenticator() const { return authenticator_; }; 35 | inline void setAuthenticator(O1Twitter *v){ authenticator_ = v; requestor = new O1Requestor(authenticator_, this); }; 36 | 37 | TwitterApiBase(QObject *parent = 0); 38 | virtual ~TwitterApiBase(); 39 | 40 | static void saveReply(CurlEasy * reply, const QString& filename); 41 | 42 | signals: 43 | void networkError(); 44 | void error(const QString& error); 45 | 46 | protected: 47 | QList basicGetParameters(); 48 | void parseEmojiInText(std::wstring& text); 49 | 50 | protected slots: 51 | void onRequestFailed(CURLcode error); 52 | 53 | protected: 54 | O1Twitter* authenticator_; 55 | O1Requestor* requestor; 56 | }; 57 | 58 | #endif /* TWITTERAPIBASE_HPP_ */ 59 | -------------------------------------------------------------------------------- /Bird10/src/WebImageView/AuthorizedWebImageView.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef AUTHORIZEDWEBIMAGEVIEW_HPP_ 21 | #define AUTHORIZEDWEBIMAGEVIEW_HPP_ 22 | 23 | #include "WebImageView.h" 24 | #include 25 | 26 | class AuthorizedWebImageView: public WebImageView 27 | { 28 | Q_OBJECT 29 | Q_PROPERTY (QUrl url READ url WRITE setUrl NOTIFY urlChanged) 30 | 31 | public: 32 | 33 | /// OAuth authenticator 34 | Q_PROPERTY(OXTwitter *authenticator READ authenticator WRITE setAuthenticator) 35 | inline OXTwitter *authenticator() const { return authenticator_; }; 36 | void setAuthenticator(OXTwitter *v); 37 | 38 | AuthorizedWebImageView(); 39 | virtual ~AuthorizedWebImageView(); 40 | 41 | void setUrl(const QUrl& url); 42 | const QUrl& url() const; 43 | 44 | signals: 45 | void urlChanged(); 46 | 47 | private slots: 48 | void onError(); 49 | 50 | private: 51 | OXTwitter* authenticator_; 52 | }; 53 | 54 | #endif /* AUTHORIZEDWEBIMAGEVIEW_HPP_ */ 55 | -------------------------------------------------------------------------------- /Bird10/src/WebImageView/WebImageView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef WEBIMAGEVIEW_H_ 21 | #define WEBIMAGEVIEW_H_ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | using namespace bb::cascades; 29 | 30 | namespace bb { 31 | namespace cascades { 32 | class ImageView; 33 | } 34 | } 35 | 36 | class WebImageView: public bb::cascades::ImageView { 37 | Q_OBJECT 38 | Q_PROPERTY (QUrl url READ url WRITE setUrl NOTIFY urlChanged) 39 | 40 | Q_PROPERTY (bool loading READ loading NOTIFY loadingChanged) 41 | bool loading(){ return mUrl != mDesiredUrl;}; 42 | 43 | public: 44 | WebImageView(); 45 | const QUrl& url() const; 46 | 47 | public Q_SLOTS: 48 | void setUrl(const QUrl& url); 49 | void clearCache(); 50 | Q_INVOKABLE QByteArray data(); 51 | 52 | protected Q_SLOTS: 53 | void imageLoaded(); 54 | void sslError(const QList& errors); 55 | 56 | signals: 57 | void urlChanged(); 58 | void loadingChanged(); 59 | void loadingFinished(); 60 | 61 | protected: 62 | static QNetworkAccessManager * mNetManager; 63 | QUrl mUrl, mDesiredUrl; 64 | QByteArray imageData; 65 | 66 | //bool isARedirectedUrl(QNetworkReply *reply); 67 | //void setURLToRedirectedUrl(QNetworkReply *reply); 68 | }; 69 | 70 | #endif /* WEBIMAGEVIEW_H_ */ 71 | -------------------------------------------------------------------------------- /Bird10/src/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include "applicationui.hpp" 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | #include 31 | 32 | using namespace bb::cascades; 33 | 34 | Q_DECL_EXPORT int main(int argc, char **argv) 35 | { 36 | Application app(argc, argv); 37 | 38 | DevelopmentSupport::install(); 39 | 40 | // Create the Application UI object, this is where the main.qml file 41 | // is loaded and the application scene is set. 42 | ApplicationUI appui; 43 | 44 | QObject::connect(&app, SIGNAL(manualExit()), &appui, SLOT(onManualExit())); 45 | app.setAutoExit(false); 46 | 47 | // Enter the application main event loop. 48 | return Application::exec(); 49 | } 50 | -------------------------------------------------------------------------------- /Bird10/src/o2/o0abstractstore.h: -------------------------------------------------------------------------------- 1 | #ifndef O0ABSTRACTSTORE_H 2 | #define O0ABSTRACTSTORE_H 3 | 4 | #include 5 | #include 6 | 7 | #include "o0export.h" 8 | 9 | /// Storage for strings. 10 | class O0_EXPORT O0AbstractStore: public QObject { 11 | Q_OBJECT 12 | 13 | public: 14 | explicit O0AbstractStore(QObject *parent = 0): QObject(parent) { 15 | } 16 | 17 | /// Retrieve a string value by key. 18 | virtual QString value(const QString &key, const QString &defaultValue = QString()) = 0; 19 | 20 | /// Set a string value for a key. 21 | virtual void setValue(const QString &key, const QString &value) = 0; 22 | }; 23 | 24 | #endif // O0ABSTRACTSTORE_H 25 | -------------------------------------------------------------------------------- /Bird10/src/o2/o0export.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // For exporting symbols from Windows' DLLs 4 | #ifdef _WIN32 5 | #ifdef O2_DLL_EXPORT 6 | #define O0_EXPORT __declspec(dllexport) 7 | #else 8 | #define O0_EXPORT __declspec(dllimport) 9 | #endif 10 | #else 11 | #define O0_EXPORT 12 | #endif -------------------------------------------------------------------------------- /Bird10/src/o2/o0requestparameter.h: -------------------------------------------------------------------------------- 1 | #ifndef O0REQUESTPARAMETER_H 2 | #define O0REQUESTPARAMETER_H 3 | 4 | #include "o0baseauth.h" 5 | 6 | /// Request parameter (name-value pair) participating in authentication. 7 | struct O0_EXPORT O0RequestParameter { 8 | O0RequestParameter(const QByteArray &n, const QByteArray &v): name(n), value(v) {} 9 | bool operator <(const O0RequestParameter &other) const { 10 | return (name == other.name)? (value < other.value): (name < other.name); 11 | } 12 | QByteArray name; 13 | QByteArray value; 14 | }; 15 | 16 | #endif // O0REQUESTPARAMETER_H 17 | -------------------------------------------------------------------------------- /Bird10/src/o2/o0settingsstore.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "o0settingsstore.h" 5 | 6 | static quint64 getHash(const QString &encryptionKey) { 7 | return QCryptographicHash::hash(encryptionKey.toLatin1(), QCryptographicHash::Sha1).toULongLong(); 8 | } 9 | 10 | O0SettingsStore::O0SettingsStore(const QString &encryptionKey, QObject *parent): 11 | O0AbstractStore(parent), crypt_(getHash(encryptionKey)) { 12 | settings_ = new QSettings(this); 13 | } 14 | 15 | O0SettingsStore::O0SettingsStore(QSettings *settings, const QString &encryptionKey, QObject *parent): 16 | O0AbstractStore(parent), crypt_(getHash(encryptionKey)) { 17 | settings_ = settings; 18 | settings_->setParent(this); 19 | } 20 | 21 | QString O0SettingsStore::groupKey() const { 22 | return groupKey_; 23 | } 24 | 25 | void O0SettingsStore::setGroupKey(const QString &groupKey) { 26 | if (groupKey_ == groupKey) { 27 | return; 28 | } 29 | groupKey_ = groupKey; 30 | Q_EMIT groupKeyChanged(); 31 | } 32 | 33 | QString O0SettingsStore::value(const QString &key, const QString &defaultValue) { 34 | QString fullKey = groupKey_.isEmpty() ? key : (groupKey_ + '/' + key); 35 | if (!settings_->contains(fullKey)) { 36 | return defaultValue; 37 | } 38 | return crypt_.decryptToString(settings_->value(fullKey).toString()); 39 | } 40 | 41 | void O0SettingsStore::setValue(const QString &key, const QString &value) { 42 | QString fullKey = groupKey_.isEmpty() ? key : (groupKey_ + '/' + key); 43 | settings_->setValue(fullKey, crypt_.encryptToString(value)); 44 | } 45 | -------------------------------------------------------------------------------- /Bird10/src/o2/o0settingsstore.h: -------------------------------------------------------------------------------- 1 | #ifndef O0SETTINGSSTORE_H 2 | #define O0SETTINGSSTORE_H 3 | 4 | #include 5 | #include 6 | 7 | #include "o0baseauth.h" 8 | #include "o0abstractstore.h" 9 | #include "o0simplecrypt.h" 10 | 11 | /// Persistent storage for authentication tokens, using QSettings. 12 | class O0_EXPORT O0SettingsStore: public O0AbstractStore { 13 | Q_OBJECT 14 | 15 | public: 16 | /// Constructor 17 | explicit O0SettingsStore(const QString &encryptionKey, QObject *parent = 0); 18 | 19 | /// Construct with an explicit QSettings instance 20 | explicit O0SettingsStore(QSettings *settings, const QString &encryptionKey, QObject *parent = 0); 21 | 22 | /// Group key prefix 23 | Q_PROPERTY(QString groupKey READ groupKey WRITE setGroupKey NOTIFY groupKeyChanged) 24 | QString groupKey() const; 25 | void setGroupKey(const QString &groupKey); 26 | 27 | /// Get a string value for a key 28 | QString value(const QString &key, const QString &defaultValue = QString()); 29 | 30 | /// Set a string value for a key 31 | void setValue(const QString &key, const QString &value); 32 | 33 | Q_SIGNALS: 34 | // Property change signals 35 | void groupKeyChanged(); 36 | 37 | protected: 38 | QSettings* settings_; 39 | QString groupKey_; 40 | O0SimpleCrypt crypt_; 41 | }; 42 | 43 | #endif // O0SETTINGSSTORE_H 44 | -------------------------------------------------------------------------------- /Bird10/src/o2/o1freshbooks.h: -------------------------------------------------------------------------------- 1 | #ifndef O1FRESHBOOKS_H 2 | #define O1FRESHBOOKS_H 3 | 4 | #include "o0export.h" 5 | #include "o1.h" 6 | 7 | /// FreshBooks authenticator. 8 | class O0_EXPORT O1Freshbooks: public O1 { 9 | Q_OBJECT 10 | 11 | public: 12 | explicit O1Freshbooks(QObject *parent = 0): O1(parent) { 13 | } 14 | 15 | void setClientId(const QString &value) { 16 | O1::setClientId(value); 17 | setRequestTokenUrl(QUrl("https://" + clientId() + ".freshbooks.com/oauth/oauth_request.php")); 18 | setAuthorizeUrl(QUrl("https://" + clientId() + ".freshbooks.com/oauth/oauth_authorize.php")); 19 | setAccessTokenUrl(QUrl("https://" + clientId() + ".freshbooks.com/oauth/oauth_access.php")); 20 | } 21 | }; 22 | 23 | #endif // O1FRESHBOOKS_H 24 | -------------------------------------------------------------------------------- /Bird10/src/o2/o1requestor.h: -------------------------------------------------------------------------------- 1 | #ifndef O1REQUESTOR_H 2 | #define O1REQUESTOR_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "o0export.h" 9 | #include "o1.h" 10 | 11 | class QNetworkAccessManager; 12 | class QNetworkReply; 13 | class O1; 14 | 15 | /// Makes authenticated requests using OAuth 1.0. 16 | class O0_EXPORT O1Requestor: public QObject { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit O1Requestor(O1 *authenticator, QObject *parent = 0); 21 | 22 | public Q_SLOTS: 23 | /// Make a GET request. 24 | /// @param req Network request. 25 | /// @param signingParameters Extra (non-OAuth) parameters participating in signing. 26 | /// @return Reply. 27 | CurlEasy* get(const QString& url, const QList &signingParameters); 28 | 29 | /// Make a POST request. 30 | /// @param req Network request. 31 | /// @param signingParameters Extra (non-OAuth) parameters participating in signing. 32 | /// @param data Request payload. 33 | /// @return Reply. 34 | CurlEasy* post(const QString& url, const QList &signingParameters, const QByteArray &data = QByteArray()); 35 | 36 | /// Make a POST request. 37 | /// @param req Network request. 38 | /// @param signingParameters Extra (non-OAuth) parameters participating in signing. 39 | /// @param multiPart HTTPMultiPart. 40 | /// @return Reply. 41 | CurlEasy* post(const QNetworkRequest &req, const QList &signingParameters, QHttpMultiPart *multiPart); 42 | 43 | /// Make a PUT request. 44 | /// @param req Network request. 45 | /// @param signingParameters Extra (non-OAuth) parameters participating in signing. 46 | /// @param data Request payload. 47 | /// @return Reply. 48 | CurlEasy* put(const QNetworkRequest &req, const QList &signingParameters, const QByteArray &data); 49 | 50 | protected: 51 | /// Return new request based on the original, with the "Authentication:" header added. 52 | CurlEasy* setup(const QString& url, const QList &signingParameters, QNetworkAccessManager::Operation operation); 53 | 54 | /// Augment reply with a timer. 55 | CurlEasy* addTimer(CurlEasy* reply); 56 | 57 | O1 *authenticator_; 58 | }; 59 | 60 | 61 | #endif // O1REQUESTOR_H 62 | -------------------------------------------------------------------------------- /Bird10/src/o2/o1timedreply.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "o1timedreply.h" 5 | 6 | O1TimedReply::O1TimedReply(QNetworkReply *parent, int pTimeout): QTimer(parent) { 7 | setSingleShot(true); 8 | setInterval(pTimeout); 9 | connect(this, SIGNAL(timeout()), this, SLOT(onTimeout())); 10 | connect(parent, SIGNAL(finished()), this, SLOT(onFinished())); 11 | } 12 | 13 | void O1TimedReply::onFinished() { 14 | stop(); 15 | Q_EMIT finished(); 16 | } 17 | 18 | void O1TimedReply::onTimeout() { 19 | Q_EMIT error(QNetworkReply::TimeoutError); 20 | } 21 | -------------------------------------------------------------------------------- /Bird10/src/o2/o1timedreply.h: -------------------------------------------------------------------------------- 1 | #ifndef O1TIMEDREPLY_H 2 | #define O1TIMEDREPLY_H 3 | 4 | #include 5 | #include 6 | 7 | #include "o0export.h" 8 | 9 | /// A timer connected to a network reply. 10 | class O0_EXPORT O1TimedReply: public QTimer { 11 | Q_OBJECT 12 | 13 | public: 14 | explicit O1TimedReply(QNetworkReply *parent, int pTimeout=60*1000); 15 | 16 | Q_SIGNALS: 17 | /// Emitted when we have timed out waiting for the network reply. 18 | void error(QNetworkReply::NetworkError); 19 | /// Emitted when the network reply has responded. 20 | void finished(); 21 | 22 | private Q_SLOTS: 23 | void onFinished(); 24 | void onTimeout(); 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Bird10/src/o2/o1twitter.h: -------------------------------------------------------------------------------- 1 | #ifndef O1TWITTER_H 2 | #define O1TWITTER_H 3 | 4 | #include "o0export.h" 5 | #include "o1.h" 6 | 7 | #include 8 | 9 | /// Twitter OAuth 1.0 client 10 | class O0_EXPORT O1Twitter: public O1 { 11 | Q_OBJECT 12 | 13 | public: 14 | explicit O1Twitter(QObject *parent = 0): O1(parent) { 15 | setRequestTokenUrl(QUrl("https://api.twitter.com/oauth/request_token")); 16 | setAuthorizeUrl(QUrl("https://api.twitter.com/oauth/authenticate")); 17 | setAccessTokenUrl(QUrl("https://api.twitter.com/oauth/access_token")); 18 | setClientId(LEGACY_CLIENT_ID); 19 | setClientSecret(LEGACY_CLIENT_ID_SECRET); 20 | } 21 | 22 | }; 23 | 24 | #endif // O1TWITTER_H 25 | -------------------------------------------------------------------------------- /Bird10/src/o2/o2.pri: -------------------------------------------------------------------------------- 1 | include(src.pri) 2 | -------------------------------------------------------------------------------- /Bird10/src/o2/o2gft.cpp: -------------------------------------------------------------------------------- 1 | #include "o2gft.h" 2 | 3 | static const char *GftScope = "https://www.googleapis.com/auth/fusiontables"; 4 | static const char *GftEndpoint = "https://accounts.google.com/o/oauth2/auth"; 5 | static const char *GftTokenUrl = "https://accounts.google.com/o/oauth2/token"; 6 | static const char *GftRefreshUrl = "https://accounts.google.com/o/oauth2/token"; 7 | 8 | O2Gft::O2Gft(QObject *parent): O2(parent) { 9 | setRequestUrl(GftEndpoint); 10 | setTokenUrl(GftTokenUrl); 11 | setRefreshTokenUrl(GftRefreshUrl); 12 | setScope(GftScope); 13 | } 14 | -------------------------------------------------------------------------------- /Bird10/src/o2/o2gft.h: -------------------------------------------------------------------------------- 1 | #ifndef O2GFT_H 2 | #define O2GFT_H 3 | 4 | #include "o0export.h" 5 | #include "o2.h" 6 | 7 | /// Google Fusion Tables' dialect of OAuth 2.0 8 | class O0_EXPORT O2Gft: public O2 { 9 | Q_OBJECT 10 | 11 | public: 12 | explicit O2Gft(QObject *parent = 0); 13 | }; 14 | 15 | #endif // O2GFT_H 16 | -------------------------------------------------------------------------------- /Bird10/src/o2/o2reply.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "o2reply.h" 5 | 6 | O2Reply::O2Reply(QNetworkReply *r, int timeOut, QObject *parent): QTimer(parent), reply(r) { 7 | setSingleShot(true); 8 | connect(this, SIGNAL(error(QNetworkReply::NetworkError)), reply, SIGNAL(error(QNetworkReply::NetworkError)), Qt::QueuedConnection); 9 | connect(this, SIGNAL(timeout()), this, SLOT(onTimeOut()), Qt::QueuedConnection); 10 | start(timeOut); 11 | } 12 | 13 | void O2Reply::onTimeOut() { 14 | Q_EMIT error(QNetworkReply::TimeoutError); 15 | } 16 | 17 | O2ReplyList::~O2ReplyList() { 18 | foreach (O2Reply *timedReply, replies_) { 19 | delete timedReply; 20 | } 21 | } 22 | 23 | void O2ReplyList::add(QNetworkReply *reply) { 24 | if (reply && ignoreSslErrors()) 25 | reply->ignoreSslErrors(); 26 | add(new O2Reply(reply)); 27 | } 28 | 29 | void O2ReplyList::add(O2Reply *reply) { 30 | replies_.append(reply); 31 | } 32 | 33 | void O2ReplyList::remove(QNetworkReply *reply) { 34 | O2Reply *o2Reply = find(reply); 35 | if (o2Reply) { 36 | o2Reply->stop(); 37 | (void)replies_.removeOne(o2Reply); 38 | } 39 | } 40 | 41 | O2Reply *O2ReplyList::find(QNetworkReply *reply) { 42 | foreach (O2Reply *timedReply, replies_) { 43 | if (timedReply->reply == reply) { 44 | return timedReply; 45 | } 46 | } 47 | return 0; 48 | } 49 | 50 | bool O2ReplyList::ignoreSslErrors() 51 | { 52 | return ignoreSslErrors_; 53 | } 54 | 55 | void O2ReplyList::setIgnoreSslErrors(bool ignoreSslErrors) 56 | { 57 | ignoreSslErrors_ = ignoreSslErrors; 58 | } 59 | -------------------------------------------------------------------------------- /Bird10/src/o2/o2reply.h: -------------------------------------------------------------------------------- 1 | #ifndef O2TIMEDREPLYLIST_H 2 | #define O2TIMEDREPLYLIST_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "o0export.h" 12 | 13 | /// A network request/reply pair that can time out. 14 | class O0_EXPORT O2Reply: public QTimer { 15 | Q_OBJECT 16 | 17 | public: 18 | O2Reply(QNetworkReply *reply, int timeOut = 60 * 1000, QObject *parent = 0); 19 | 20 | Q_SIGNALS: 21 | void error(QNetworkReply::NetworkError); 22 | 23 | public Q_SLOTS: 24 | /// When time out occurs, the QNetworkReply's error() signal is triggered. 25 | void onTimeOut(); 26 | 27 | public: 28 | QNetworkReply *reply; 29 | }; 30 | 31 | /// List of O2Replies. 32 | class O2ReplyList { 33 | public: 34 | O2ReplyList() { ignoreSslErrors_ = false; } 35 | 36 | /// Destructor. 37 | /// Deletes all O2Reply instances in the list. 38 | virtual ~O2ReplyList(); 39 | 40 | /// Create a new O2Reply from a QNetworkReply, and add it to this list. 41 | void add(QNetworkReply *reply); 42 | 43 | /// Add an O2Reply to the list, while taking ownership of it. 44 | void add(O2Reply *reply); 45 | 46 | /// Remove item from the list that corresponds to a QNetworkReply. 47 | void remove(QNetworkReply *reply); 48 | 49 | /// Find an O2Reply in the list, corresponding to a QNetworkReply. 50 | /// @return Matching O2Reply or NULL. 51 | O2Reply *find(QNetworkReply *reply); 52 | 53 | bool ignoreSslErrors(); 54 | void setIgnoreSslErrors(bool ignoreSslErrors); 55 | 56 | protected: 57 | QList replies_; 58 | bool ignoreSslErrors_; 59 | }; 60 | 61 | #endif // O2TIMEDREPLYLIST_H 62 | -------------------------------------------------------------------------------- /Bird10/src/o2/o2replyserver.h: -------------------------------------------------------------------------------- 1 | #ifndef O2REPLYSERVER_H 2 | #define O2REPLYSERVER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "o0export.h" 10 | 11 | /// HTTP server to process authentication response. 12 | class O0_EXPORT O2ReplyServer: public QTcpServer { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit O2ReplyServer(QObject *parent = 0); 17 | 18 | /// Page content on local host after successful oauth - in case you do not want to close the browser, but display something 19 | Q_PROPERTY(QByteArray replyContent READ replyContent WRITE setReplyContent) 20 | QByteArray replyContent(); 21 | void setReplyContent(const QByteArray &value); 22 | 23 | Q_SIGNALS: 24 | void verificationReceived(QMap); 25 | 26 | public Q_SLOTS: 27 | void onIncomingConnection(); 28 | void onBytesReady(); 29 | QMap parseQueryParams(QByteArray *data); 30 | 31 | protected: 32 | QByteArray replyContent_; 33 | }; 34 | 35 | #endif // O2REPLYSERVER_H 36 | -------------------------------------------------------------------------------- /Bird10/src/o2/o2requestor.h: -------------------------------------------------------------------------------- 1 | #ifndef O2REQUESTOR_H 2 | #define O2REQUESTOR_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "o0export.h" 12 | #include "o2reply.h" 13 | 14 | class O2; 15 | 16 | /// Makes authenticated requests. 17 | class O0_EXPORT O2Requestor: public QObject { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit O2Requestor(QNetworkAccessManager *manager, O2 *authenticator, QObject *parent = 0); 22 | ~O2Requestor(); 23 | 24 | public Q_SLOTS: 25 | /// Make a GET request. 26 | /// @return Request ID or -1 if there are too many requests in the queue. 27 | int get(const QNetworkRequest &req); 28 | 29 | /// Make a POST request. 30 | /// @return Request ID or -1 if there are too many requests in the queue. 31 | int post(const QNetworkRequest &req, const QByteArray &data); 32 | 33 | /// Make a PUT request. 34 | /// @return Request ID or -1 if there are too many requests in the queue. 35 | int put(const QNetworkRequest &req, const QByteArray &data); 36 | 37 | Q_SIGNALS: 38 | /// Emitted when a request has been completed or failed. 39 | void finished(int id, QNetworkReply::NetworkError error, QByteArray data); 40 | 41 | /// Emitted when an upload has progressed. 42 | void uploadProgress(int id, qint64 bytesSent, qint64 bytesTotal); 43 | 44 | protected Q_SLOTS: 45 | /// Handle refresh completion. 46 | void onRefreshFinished(QNetworkReply::NetworkError error); 47 | 48 | /// Handle request finished. 49 | void onRequestFinished(); 50 | 51 | /// Handle request error. 52 | void onRequestError(QNetworkReply::NetworkError error); 53 | 54 | /// Re-try request (after successful token refresh). 55 | void retry(); 56 | 57 | /// Finish the request, Q_EMIT finished() signal. 58 | void finish(); 59 | 60 | /// Handle upload progress. 61 | void onUploadProgress(qint64 uploaded, qint64 total); 62 | 63 | protected: 64 | int setup(const QNetworkRequest &request, QNetworkAccessManager::Operation operation); 65 | 66 | enum Status { 67 | Idle, Requesting, ReRequesting 68 | }; 69 | 70 | QNetworkAccessManager *manager_; 71 | O2 *authenticator_; 72 | QNetworkRequest request_; 73 | QByteArray data_; 74 | QNetworkReply *reply_; 75 | Status status_; 76 | int id_; 77 | QNetworkAccessManager::Operation operation_; 78 | QUrl url_; 79 | O2ReplyList timedReplies_; 80 | QNetworkReply::NetworkError error_; 81 | }; 82 | 83 | #endif // O2REQUESTOR_H 84 | -------------------------------------------------------------------------------- /Bird10/src/o2/oxtwitter.h: -------------------------------------------------------------------------------- 1 | #ifndef OXTWITTER_H 2 | #define OXTWITTER_H 3 | 4 | #include "o0export.h" 5 | #include "o1twitter.h" 6 | 7 | /// Twitter authenticator using Twitter XAuth 8 | class O0_EXPORT OXTwitter: public O1Twitter { 9 | Q_OBJECT 10 | 11 | public: 12 | explicit OXTwitter(QObject *parent = 0); 13 | 14 | /// XAuth Username 15 | Q_PROPERTY(QString username READ username WRITE setUsername NOTIFY usernameChanged) 16 | QString username(); 17 | void setUsername(const QString &username); 18 | 19 | /// XAuth Password 20 | Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged) 21 | QString password(); 22 | void setPassword(const QString &password); 23 | 24 | 25 | Q_PROPERTY(QString screen_name READ screenName) 26 | QString screenName(); 27 | 28 | public Q_SLOTS: 29 | /// Authenticate. 30 | Q_INVOKABLE virtual void link(); 31 | void onTokenRequestFinished(CURLcode code); 32 | void onGuestTokenRequestFinished(CURLcode code); 33 | void onChallengeSuccess(); 34 | 35 | 36 | Q_SIGNALS: 37 | void usernameChanged(); 38 | void passwordChanged(); 39 | 40 | private: 41 | // QList xAuthParams_; 42 | QString username_; 43 | QString password_; 44 | QString user_id, screen_name; 45 | QString login_verification_user_id, login_verification_request_id; 46 | }; 47 | 48 | #endif // OXTWITTER_H 49 | -------------------------------------------------------------------------------- /Bird10/src/o2/src.pri: -------------------------------------------------------------------------------- 1 | QT *= network 2 | 3 | # script module is deprecated since Qt 5.5 (http://wiki.qt.io/New-Features-in-Qt-5.5) 4 | !qtHaveModule(qml): QT *= script 5 | qtHaveModule(qml): QT *= qml 6 | 7 | INCLUDEPATH += $$PWD 8 | SOURCES += \ 9 | $$PWD/o1.cpp \ 10 | $$PWD/o1requestor.cpp \ 11 | $$PWD/o1timedreply.cpp \ 12 | $$PWD/o2.cpp \ 13 | $$PWD/o2facebook.cpp \ 14 | $$PWD/o2gft.cpp \ 15 | $$PWD/o2reply.cpp \ 16 | $$PWD/o2replyserver.cpp \ 17 | $$PWD/o2requestor.cpp \ 18 | $$PWD/o2skydrive.cpp \ 19 | $$PWD/oxtwitter.cpp \ 20 | $$PWD/o2simplecrypt.cpp \ 21 | $$PWD/o0baseauth.cpp \ 22 | $$PWD/o0settingsstore.cpp \ 23 | $$PWD/o2spotify.cpp 24 | 25 | HEADERS += \ 26 | $$PWD/o1.h \ 27 | $$PWD/o1dropbox.h \ 28 | $$PWD/o1flickr.h \ 29 | $$PWD/o1requestor.h \ 30 | $$PWD/o1twitter.h \ 31 | $$PWD/o1timedreply.h \ 32 | $$PWD/o2.h \ 33 | $$PWD/o2facebook.h \ 34 | $$PWD/o2gft.h \ 35 | $$PWD/o2reply.h \ 36 | $$PWD/o2replyserver.h \ 37 | $$PWD/o2requestor.h \ 38 | $$PWD/o2skydrive.h \ 39 | $$PWD/oxtwitter.h \ 40 | $$PWD/o1freshbooks.h \ 41 | $$PWD/o0baseauth.h \ 42 | $$PWD/o0globals.h \ 43 | $$PWD/o0simplecrypt.h \ 44 | $$PWD/o0requestparameter.h \ 45 | $$PWD/o0abstractstore.h \ 46 | $$PWD/o0settingsstore.h \ 47 | $$PWD/o2spotify.h 48 | -------------------------------------------------------------------------------- /Bird10/src/secret.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef SECRET_H 21 | #define SECRET_H 22 | 23 | #define CLIENT_ID "3nVuSoBZnx6U4vzUxf5w" 24 | #define CLIENT_ID_SECRET "Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys" 25 | 26 | #endif // SECRET_H 27 | -------------------------------------------------------------------------------- /Bird10/translations/CascadesProject.pro: -------------------------------------------------------------------------------- 1 | include (../CascadesProject.pro) 2 | -------------------------------------------------------------------------------- /Bird10/translations/CascadesProject.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Bird10/translations/Makefile: -------------------------------------------------------------------------------- 1 | QMAKE_TARGET = CascadesProject 2 | LUPDATE = $(QNX_HOST)/usr/bin/lupdate 3 | LRELEASE = $(QNX_HOST)/usr/bin/lrelease 4 | 5 | update: $(QMAKE_TARGET).pro FORCE 6 | $(LUPDATE) $(QMAKE_TARGET).pro 7 | 8 | release: $(QMAKE_TARGET).pro $(QMAKE_TARGET).ts 9 | $(LRELEASE) $(QMAKE_TARGET).pro 10 | 11 | FORCE: 12 | 13 | -------------------------------------------------------------------------------- /Bird10HeadlessService/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Bird10HeadlessService 4 | 5 | 6 | 7 | 8 | 9 | com.rim.tad.tools.qml.core.qmlFileBuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.jsdt.core.javascriptValidator 20 | 21 | 22 | 23 | 24 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 25 | auto,full,incremental, 26 | 27 | 28 | 29 | 30 | com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder 31 | 32 | 33 | 34 | 35 | 36 | org.eclipse.wst.jsdt.core.jsNature 37 | org.eclipse.cdt.core.cnature 38 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 39 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 40 | com.qnx.tools.ide.bbt.core.bbtnature 41 | org.eclipse.cdt.core.ccnature 42 | org.eclipse.cdt.qt.core.qtNature 43 | com.rim.tad.tools.qml.core.qmlNature 44 | 45 | 46 | -------------------------------------------------------------------------------- /Bird10HeadlessService/Bird10HeadlessService.pro: -------------------------------------------------------------------------------- 1 | APP_NAME = Bird10HeadlessService 2 | 3 | CONFIG += qt warn_on 4 | 5 | include(config.pri) 6 | 7 | LIBS += -lbb -lbbsystem -lbbplatform -lbbdata 8 | LIBS += -lcURL -lcrypto 9 | 10 | QT += network 11 | -------------------------------------------------------------------------------- /Bird10HeadlessService/Makefile: -------------------------------------------------------------------------------- 1 | QMAKE_TARGET = Bird10HeadlessService 2 | PROJECT_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) 3 | I18N_DIR := $(PROJECT_DIR)/translations 4 | 5 | include mk/cs-base.mk 6 | 7 | -------------------------------------------------------------------------------- /Bird10HeadlessService/precompiled.h: -------------------------------------------------------------------------------- 1 | // This file is used to store precompiled headers. 2 | // It is intentionally left blank. It is up to you to decide which headers should be included here. 3 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/DMNotificator.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef DMNOTIFICATOR_HPP_ 21 | #define DMNOTIFICATOR_HPP_ 22 | 23 | #include "Notificator.hpp" 24 | 25 | class DMNotificator: public Notificator 26 | { 27 | Q_OBJECT 28 | public: 29 | DMNotificator(OXTwitter* authenticator, QSettings* settings, QObject* parent); 30 | 31 | void checkTwitterNotifications(); 32 | 33 | protected slots: 34 | void onNotifications(); 35 | 36 | protected: 37 | void sendNotification(const QString& body, const QString& conversation_id); 38 | void deleteNotification(const QString& conversation_id); 39 | void deleteAll(); 40 | 41 | QString buildBody(const QVariantMap& conversation); 42 | }; 43 | 44 | #endif /* DMNOTIFICATOR_HPP_ */ 45 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/Notificator.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef NOTIFICATOR_HPP_ 21 | #define NOTIFICATOR_HPP_ 22 | 23 | #include 24 | #include 25 | #include "o2/oxtwitter.h" 26 | 27 | #ifdef QT_DEBUG 28 | #define NOTIFICATION_TITLE "Bird10 (debug)" 29 | #else 30 | #define NOTIFICATION_TITLE "Bird10" 31 | #endif 32 | 33 | 34 | class Notificator : public QObject 35 | { 36 | Q_OBJECT 37 | public: 38 | Notificator(OXTwitter* authenticator, QSettings* settings, QObject* parent); 39 | 40 | void checkTwitterNotifications(); 41 | 42 | signals: 43 | void done(); 44 | 45 | protected slots: 46 | void onNotifications(); 47 | void onError(); 48 | 49 | protected: 50 | void sendNotification(const QString& body, const QString& sortIndex); 51 | void deleteNotification(const QString& key); 52 | 53 | QString buildBody(const QVariantMap& notification); 54 | 55 | protected: 56 | 57 | OXTwitter* m_authenticator; 58 | QSettings* m_settings; 59 | }; 60 | 61 | #endif /* NOTIFICATOR_HPP_ */ 62 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/QJson4/QJsonParseError.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 - 2016 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include "QJsonParseError.h" 20 | 21 | #if QT_VERSION < 0x050000 22 | 23 | //------------------------------------------------------------------------------ 24 | // Name: errorString 25 | // Desc: The QJsonParseError class is used to report errors during JSON parsing. 26 | //------------------------------------------------------------------------------ 27 | QString QJsonParseError::errorString() const { 28 | switch(error) { 29 | case NoError: 30 | return "No error occurred"; 31 | case UnterminatedObject: 32 | return "unterminated object"; 33 | case MissingNameSeparator: 34 | return "missing name separator"; 35 | case UnterminatedArray: 36 | return "unterminated array"; 37 | case MissingValueSeparator: 38 | return "missing value separator"; 39 | case IllegalValue: 40 | return "illegal value"; 41 | case TerminationByNumber: 42 | return "invalid termination by number"; 43 | case IllegalNumber: 44 | return "illegal number"; 45 | case IllegalEscapeSequence: 46 | return "illegal escape sequence"; 47 | case IllegalUTF8String: 48 | return "invalid UTF8 string"; 49 | case UnterminatedString: 50 | return "unterminated string"; 51 | case MissingObject: 52 | return "object is missing after a comma"; 53 | case DeepNesting: 54 | return "too deeply nested document"; 55 | case DocumentTooLarge: 56 | return "too large document"; 57 | case GarbageAtEnd: 58 | return "garbage at the end of the document"; 59 | } 60 | 61 | return QString(); 62 | } 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/QJson4/QJsonParseError.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 - 2016 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef QJSON_PARSE_ERROR_H_ 20 | #define QJSON_PARSE_ERROR_H_ 21 | 22 | #include 23 | 24 | #if QT_VERSION >= 0x050000 25 | #include 26 | #else 27 | 28 | #include 29 | 30 | class QJsonParseError { 31 | public: 32 | enum ParseError { 33 | NoError = 0, 34 | UnterminatedObject = 1, 35 | MissingNameSeparator = 2, 36 | UnterminatedArray = 3, 37 | MissingValueSeparator = 4, 38 | IllegalValue = 5, 39 | TerminationByNumber = 6, 40 | IllegalNumber = 7, 41 | IllegalEscapeSequence = 8, 42 | IllegalUTF8String = 9, 43 | UnterminatedString = 10, 44 | MissingObject = 11, 45 | DeepNesting = 12, 46 | DocumentTooLarge = 13, 47 | GarbageAtEnd = 14 48 | }; 49 | 50 | public: 51 | QString errorString() const; 52 | 53 | public: 54 | ParseError error; 55 | int offset; 56 | }; 57 | 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/QJson4/QJsonParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 - 2016 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | // NOTE: this is not part of the "public" Qt API, so using this class directly 20 | // is not recomended 21 | 22 | #ifndef QJSON_PARSER_H_ 23 | #define QJSON_PARSER_H_ 24 | 25 | #include 26 | 27 | #if QT_VERSION < 0x050000 28 | 29 | #include "QJsonParseError.h" 30 | #include 31 | class QJsonRoot; 32 | class QJsonObject; 33 | class QJsonArray; 34 | class QJsonValue; 35 | 36 | class QJsonParser { 37 | friend class QJsonDocument; 38 | 39 | public: 40 | QJsonParser(const char *begin, const char *end); 41 | 42 | public: 43 | QJsonRoot *parse(); 44 | 45 | public: 46 | QJsonParseError state() const; 47 | 48 | private: 49 | static const char ArrayBegin = '['; 50 | static const char ArrayEnd = ']'; 51 | static const char NameSeparator = ':'; 52 | static const char ValueSeparator = ','; 53 | static const char ObjectBegin = '{'; 54 | static const char ObjectEnd = '}'; 55 | static const char Quote = '"'; 56 | 57 | private: 58 | char peek(); 59 | QJsonObject *getObject(); 60 | QJsonArray *getArray(); 61 | QJsonValue getValue(); 62 | QString getString(); 63 | QJsonValue getTrue(); 64 | QJsonValue getFalse(); 65 | QJsonValue getNull(); 66 | QJsonValue getNumber(); 67 | QPair getPair(); 68 | 69 | private: 70 | void throwError(QJsonParseError::ParseError e); 71 | 72 | private: 73 | QJsonParseError state_; 74 | const char *const begin_; 75 | const char *const end_; 76 | const char * p_; 77 | }; 78 | 79 | #endif 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/QJson4/QJsonRoot.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 - 2016 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | // NOTE: this is not part of the "public" Qt API, so using this class directly 20 | // is not recomended 21 | 22 | #ifndef QJSON_ROOT_H_ 23 | #define QJSON_ROOT_H_ 24 | 25 | #include 26 | 27 | #if QT_VERSION < 0x050000 28 | 29 | class QJsonObject; 30 | class QJsonArray; 31 | 32 | class QJsonRoot { 33 | public: 34 | virtual ~QJsonRoot() {}; 35 | 36 | public: 37 | virtual QJsonRoot *clone() const = 0; 38 | 39 | public: 40 | virtual QJsonArray *toArray() = 0; 41 | virtual QJsonObject *toObject() = 0; 42 | virtual const QJsonArray *toArray() const = 0; 43 | virtual const QJsonObject *toObject() const = 0; 44 | }; 45 | 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/QJson4/QJsonValueRef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 - 2016 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef QJSON_VALUEREF_H_ 20 | #define QJSON_VALUEREF_H_ 21 | 22 | #include 23 | 24 | #if QT_VERSION >= 0x050000 25 | #include 26 | #else 27 | 28 | #include "QJsonValue.h" 29 | class QJsonRoot; 30 | 31 | class QJsonValueRef { 32 | public: 33 | QJsonValueRef(QJsonArray *array, int idx); 34 | 35 | // slight variant from official APIs implementation 36 | QJsonValueRef(QJsonObject *object, const QString &key); 37 | 38 | public: 39 | operator QJsonValue() const; 40 | 41 | public: 42 | QJsonValueRef &operator=(const QJsonValue &val); 43 | QJsonValueRef &operator=(const QJsonValueRef &val); 44 | 45 | public: 46 | QJsonValue::Type type() const; 47 | bool isNull() const; 48 | bool isBool() const; 49 | bool isDouble() const; 50 | bool isString() const; 51 | bool isArray() const; 52 | bool isObject() const; 53 | bool isUndefined() const; 54 | 55 | public: 56 | bool toBool() const; 57 | double toDouble() const; 58 | QString toString() const; 59 | QJsonArray toArray() const; 60 | QJsonObject toObject() const; 61 | int toInt(int defaultValue = 0) const; 62 | 63 | public: 64 | bool operator==(const QJsonValue &other) const; 65 | bool operator!=(const QJsonValue &other) const; 66 | 67 | private: 68 | QJsonValue toValue() const; 69 | void swap(QJsonValueRef &other); 70 | 71 | private: 72 | QJsonRoot *p_; 73 | int index_; 74 | QString key_; 75 | }; 76 | 77 | #endif 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/QtCurl/CurlMulti.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef CURLMULTI_H 21 | #define CURLMULTI_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | class QTimer; 29 | class CurlEasy; 30 | struct CurlMultiSocket; 31 | 32 | class CurlMulti : public QObject 33 | { 34 | Q_OBJECT 35 | public: 36 | explicit CurlMulti(QObject *parent = 0); 37 | virtual ~CurlMulti(); 38 | 39 | static CurlMulti* threadInstance(); 40 | 41 | void addTransfer(CurlEasy *transfer); 42 | void removeTransfer(CurlEasy *transfer); 43 | 44 | protected slots: 45 | void curlMultiPerform(); 46 | void curlMultiTimeout(); 47 | void socketReadyRead(int socketDescriptor); 48 | void socketReadyWrite(int socketDescriptor); 49 | void socketException(int socketDescriptor); 50 | 51 | protected: 52 | void curlSocketAction(curl_socket_t socketDescriptor, int eventsBitmask); 53 | int curlTimerFunction(int timeoutMsec); 54 | int curlSocketFunction(CURL *easyHandle, curl_socket_t socketDescriptor, int action, CurlMultiSocket *socket); 55 | static int staticCurlTimerFunction(CURLM *multiHandle, long timeoutMs, void *userp); 56 | static int staticCurlSocketFunction(CURL *easyHandle, curl_socket_t socketDescriptor, int what, void *userp, void *sockp); 57 | 58 | CURLM *handle_; 59 | int running_; 60 | 61 | int newerTimerExists, lastTimerHandled, counter; 62 | QMutex* mutex; 63 | 64 | QSet transfers_; 65 | }; 66 | 67 | #endif // CURLMULTIINTERFACE_H 68 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/TwitterApiBase.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef TWITTERAPIBASE_HPP_ 21 | #define TWITTERAPIBASE_HPP_ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | class TwitterApiBase : public QObject 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | /// OAuth authenticator 33 | Q_PROPERTY(OXTwitter *authenticator READ authenticator WRITE setAuthenticator) 34 | inline OXTwitter *authenticator() const { return authenticator_; }; 35 | inline void setAuthenticator(OXTwitter *v){ authenticator_ = v; requestor = new O1Requestor(authenticator_, this); }; 36 | 37 | TwitterApiBase(QObject *parent = 0); 38 | virtual ~TwitterApiBase(); 39 | 40 | signals: 41 | void networkError(); 42 | void error(const QString& error); 43 | 44 | protected: 45 | QList basicGetParameters(); 46 | void saveReply(CurlEasy * reply, const QString& filename); 47 | 48 | protected slots: 49 | void onRequestFailed(CURLcode error); 50 | 51 | protected: 52 | OXTwitter* authenticator_; 53 | O1Requestor* requestor; 54 | }; 55 | 56 | #endif /* TWITTERAPIBASE_HPP_ */ 57 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/logger/logger.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "logger.h" 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace std; 9 | 10 | 11 | // -------------------------------------- 12 | // static members initialization 13 | // -------------------------------------- 14 | 15 | const string Logger::PRIORITY_NAMES[] = 16 | { 17 | "DEBUG", 18 | "CONFIG", 19 | "INFO", 20 | "WARNING", 21 | "ERROR" 22 | }; 23 | 24 | Logger Logger::instance; 25 | 26 | 27 | // -------------------------------------- 28 | // function implementations 29 | // -------------------------------------- 30 | 31 | Logger::Logger() : active(false) {} 32 | 33 | void Logger::Start(Priority minPriority, const string& logFile) 34 | { 35 | instance.active = true; 36 | instance.minPriority = minPriority; 37 | if (logFile != "") 38 | { 39 | instance.fileStream.open(logFile.c_str(), std::ofstream::out | std::ofstream::app); 40 | } 41 | } 42 | 43 | void Logger::Stop() 44 | { 45 | instance.active = false; 46 | if (instance.fileStream.is_open()) 47 | { 48 | instance.fileStream.close(); 49 | } 50 | } 51 | 52 | void Logger::Write(Priority priority, const QString& message) 53 | { 54 | if (instance.active && priority >= instance.minPriority) 55 | { 56 | // identify current output stream 57 | ostream& stream 58 | = instance.fileStream.is_open() ? instance.fileStream : std::cout; 59 | 60 | stream << PRIORITY_NAMES[priority] 61 | << ": " 62 | << message.toStdString() 63 | << endl; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/logger/logger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace std; 9 | 10 | class Logger 11 | { 12 | public: 13 | // log priorities 14 | enum Priority 15 | { 16 | DEBUG, 17 | CONFIG, 18 | INFO, 19 | WARNING, 20 | ERROR 21 | }; 22 | 23 | // start/stop logging 24 | // - messages with priority >= minPriority will be written in log 25 | // - set logFile = "" to write to standard output 26 | static void Start(Priority minPriority, const string& logFile); 27 | static void Stop(); 28 | 29 | // write message 30 | static void Write(Priority priority, const QString& message); 31 | 32 | 33 | private: 34 | // Logger adheres to the singleton design pattern, hence the private 35 | // constructor, copy constructor and assignment operator. 36 | Logger(); 37 | Logger(const Logger& logger) {} 38 | Logger& operator = (const Logger& logger) {} 39 | 40 | // private instance data 41 | bool active; 42 | ofstream fileStream; 43 | Priority minPriority; 44 | 45 | // names describing the items in enum Priority 46 | static const string PRIORITY_NAMES[]; 47 | // the sole Logger instance (singleton) 48 | static Logger instance; 49 | }; 50 | 51 | 52 | #ifdef QT_DEBUG 53 | #define ENABLE_LOGGER 54 | #endif 55 | 56 | #ifdef ENABLE_LOGGER 57 | 58 | #define LOGGER_START(MIN_PRIORITY, FILE) Logger::Start(MIN_PRIORITY, FILE); 59 | #define LOGGER_STOP() Logger::Stop(); 60 | #define LOGGER_WRITE(PRIORITY, MESSAGE) Logger::Write(PRIORITY, MESSAGE); 61 | #define LOG(MESSAGE) Logger::Write(Logger::INFO, MESSAGE); 62 | 63 | #else 64 | 65 | #define LOGGER_START(MIN_PRIORITY, FILE) 66 | #define LOGGER_STOP() 67 | #define LOGGER_WRITE(PRIORITY, MESSAGE) 68 | #define LOG(MESSAGE) 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include "service.hpp" 21 | 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | #include "logger/logger.h" 28 | 29 | 30 | using namespace bb; 31 | 32 | 33 | int main(int argc, char **argv) 34 | { 35 | 36 | LOGGER_START(Logger::INFO, "./shared/documents/bird10service.txt") 37 | 38 | Application app(argc, argv); 39 | 40 | // Create the Application UI object, this is where the main.qml file 41 | // is loaded and the application scene is set. 42 | Service srv; 43 | 44 | // Enter the application main event loop. 45 | return Application::exec(); 46 | } 47 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o0abstractstore.h: -------------------------------------------------------------------------------- 1 | #ifndef O0ABSTRACTSTORE_H 2 | #define O0ABSTRACTSTORE_H 3 | 4 | #include 5 | #include 6 | 7 | #include "o0export.h" 8 | 9 | /// Storage for strings. 10 | class O0_EXPORT O0AbstractStore: public QObject { 11 | Q_OBJECT 12 | 13 | public: 14 | explicit O0AbstractStore(QObject *parent = 0): QObject(parent) { 15 | } 16 | 17 | /// Retrieve a string value by key. 18 | virtual QString value(const QString &key, const QString &defaultValue = QString()) = 0; 19 | 20 | /// Set a string value for a key. 21 | virtual void setValue(const QString &key, const QString &value) = 0; 22 | }; 23 | 24 | #endif // O0ABSTRACTSTORE_H 25 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o0export.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // For exporting symbols from Windows' DLLs 4 | #ifdef _WIN32 5 | #ifdef O2_DLL_EXPORT 6 | #define O0_EXPORT __declspec(dllexport) 7 | #else 8 | #define O0_EXPORT __declspec(dllimport) 9 | #endif 10 | #else 11 | #define O0_EXPORT 12 | #endif -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o0requestparameter.h: -------------------------------------------------------------------------------- 1 | #ifndef O0REQUESTPARAMETER_H 2 | #define O0REQUESTPARAMETER_H 3 | 4 | #include "o0baseauth.h" 5 | 6 | /// Request parameter (name-value pair) participating in authentication. 7 | struct O0_EXPORT O0RequestParameter { 8 | O0RequestParameter(const QByteArray &n, const QByteArray &v): name(n), value(v) {} 9 | bool operator <(const O0RequestParameter &other) const { 10 | return (name == other.name)? (value < other.value): (name < other.name); 11 | } 12 | QByteArray name; 13 | QByteArray value; 14 | }; 15 | 16 | #endif // O0REQUESTPARAMETER_H 17 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o0settingsstore.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "o0settingsstore.h" 5 | 6 | static quint64 getHash(const QString &encryptionKey) { 7 | return QCryptographicHash::hash(encryptionKey.toLatin1(), QCryptographicHash::Sha1).toULongLong(); 8 | } 9 | 10 | O0SettingsStore::O0SettingsStore(const QString &encryptionKey, QObject *parent): 11 | O0AbstractStore(parent), crypt_(getHash(encryptionKey)) { 12 | settings_ = new QSettings(this); 13 | } 14 | 15 | O0SettingsStore::O0SettingsStore(QSettings *settings, const QString &encryptionKey, QObject *parent): 16 | O0AbstractStore(parent), crypt_(getHash(encryptionKey)) { 17 | settings_ = settings; 18 | settings_->setParent(this); 19 | } 20 | 21 | QString O0SettingsStore::groupKey() const { 22 | return groupKey_; 23 | } 24 | 25 | void O0SettingsStore::setGroupKey(const QString &groupKey) { 26 | if (groupKey_ == groupKey) { 27 | return; 28 | } 29 | groupKey_ = groupKey; 30 | Q_EMIT groupKeyChanged(); 31 | } 32 | 33 | QString O0SettingsStore::value(const QString &key, const QString &defaultValue) { 34 | QString fullKey = groupKey_.isEmpty() ? key : (groupKey_ + '/' + key); 35 | if (!settings_->contains(fullKey)) { 36 | return defaultValue; 37 | } 38 | return crypt_.decryptToString(settings_->value(fullKey).toString()); 39 | } 40 | 41 | void O0SettingsStore::setValue(const QString &key, const QString &value) { 42 | QString fullKey = groupKey_.isEmpty() ? key : (groupKey_ + '/' + key); 43 | settings_->setValue(fullKey, crypt_.encryptToString(value)); 44 | } 45 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o0settingsstore.h: -------------------------------------------------------------------------------- 1 | #ifndef O0SETTINGSSTORE_H 2 | #define O0SETTINGSSTORE_H 3 | 4 | #include 5 | #include 6 | 7 | #include "o0baseauth.h" 8 | #include "o0abstractstore.h" 9 | #include "o0simplecrypt.h" 10 | 11 | /// Persistent storage for authentication tokens, using QSettings. 12 | class O0_EXPORT O0SettingsStore: public O0AbstractStore { 13 | Q_OBJECT 14 | 15 | public: 16 | /// Constructor 17 | explicit O0SettingsStore(const QString &encryptionKey, QObject *parent = 0); 18 | 19 | /// Construct with an explicit QSettings instance 20 | explicit O0SettingsStore(QSettings *settings, const QString &encryptionKey, QObject *parent = 0); 21 | 22 | /// Group key prefix 23 | Q_PROPERTY(QString groupKey READ groupKey WRITE setGroupKey NOTIFY groupKeyChanged) 24 | QString groupKey() const; 25 | void setGroupKey(const QString &groupKey); 26 | 27 | /// Get a string value for a key 28 | QString value(const QString &key, const QString &defaultValue = QString()); 29 | 30 | /// Set a string value for a key 31 | void setValue(const QString &key, const QString &value); 32 | 33 | Q_SIGNALS: 34 | // Property change signals 35 | void groupKeyChanged(); 36 | 37 | protected: 38 | QSettings* settings_; 39 | QString groupKey_; 40 | O0SimpleCrypt crypt_; 41 | }; 42 | 43 | #endif // O0SETTINGSSTORE_H 44 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o1freshbooks.h: -------------------------------------------------------------------------------- 1 | #ifndef O1FRESHBOOKS_H 2 | #define O1FRESHBOOKS_H 3 | 4 | #include "o0export.h" 5 | #include "o1.h" 6 | 7 | /// FreshBooks authenticator. 8 | class O0_EXPORT O1Freshbooks: public O1 { 9 | Q_OBJECT 10 | 11 | public: 12 | explicit O1Freshbooks(QObject *parent = 0): O1(parent) { 13 | } 14 | 15 | void setClientId(const QString &value) { 16 | O1::setClientId(value); 17 | setRequestTokenUrl(QUrl("https://" + clientId() + ".freshbooks.com/oauth/oauth_request.php")); 18 | setAuthorizeUrl(QUrl("https://" + clientId() + ".freshbooks.com/oauth/oauth_authorize.php")); 19 | setAccessTokenUrl(QUrl("https://" + clientId() + ".freshbooks.com/oauth/oauth_access.php")); 20 | } 21 | }; 22 | 23 | #endif // O1FRESHBOOKS_H 24 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o1requestor.h: -------------------------------------------------------------------------------- 1 | #ifndef O1REQUESTOR_H 2 | #define O1REQUESTOR_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "o0export.h" 9 | #include "o1.h" 10 | 11 | class QNetworkAccessManager; 12 | class QNetworkReply; 13 | class O1; 14 | 15 | /// Makes authenticated requests using OAuth 1.0. 16 | class O0_EXPORT O1Requestor: public QObject { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit O1Requestor(O1 *authenticator, QObject *parent = 0); 21 | 22 | public Q_SLOTS: 23 | /// Make a GET request. 24 | /// @param req Network request. 25 | /// @param signingParameters Extra (non-OAuth) parameters participating in signing. 26 | /// @return Reply. 27 | CurlEasy* get(const QString& url, const QList &signingParameters); 28 | 29 | /// Make a POST request. 30 | /// @param req Network request. 31 | /// @param signingParameters Extra (non-OAuth) parameters participating in signing. 32 | /// @param data Request payload. 33 | /// @return Reply. 34 | CurlEasy* post(const QString& url, const QList &signingParameters, const QByteArray &data = QByteArray()); 35 | 36 | /// Make a POST request. 37 | /// @param req Network request. 38 | /// @param signingParameters Extra (non-OAuth) parameters participating in signing. 39 | /// @param multiPart HTTPMultiPart. 40 | /// @return Reply. 41 | CurlEasy* post(const QNetworkRequest &req, const QList &signingParameters, QHttpMultiPart *multiPart); 42 | 43 | /// Make a PUT request. 44 | /// @param req Network request. 45 | /// @param signingParameters Extra (non-OAuth) parameters participating in signing. 46 | /// @param data Request payload. 47 | /// @return Reply. 48 | CurlEasy* put(const QNetworkRequest &req, const QList &signingParameters, const QByteArray &data); 49 | 50 | protected: 51 | /// Return new request based on the original, with the "Authentication:" header added. 52 | CurlEasy* setup(const QString& url, const QList &signingParameters, QNetworkAccessManager::Operation operation); 53 | 54 | /// Augment reply with a timer. 55 | CurlEasy* addTimer(CurlEasy* reply); 56 | 57 | O1 *authenticator_; 58 | }; 59 | 60 | 61 | #endif // O1REQUESTOR_H 62 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o1timedreply.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "o1timedreply.h" 5 | 6 | O1TimedReply::O1TimedReply(QNetworkReply *parent, int pTimeout): QTimer(parent) { 7 | setSingleShot(true); 8 | setInterval(pTimeout); 9 | connect(this, SIGNAL(timeout()), this, SLOT(onTimeout())); 10 | connect(parent, SIGNAL(finished()), this, SLOT(onFinished())); 11 | } 12 | 13 | void O1TimedReply::onFinished() { 14 | stop(); 15 | Q_EMIT finished(); 16 | } 17 | 18 | void O1TimedReply::onTimeout() { 19 | Q_EMIT error(QNetworkReply::TimeoutError); 20 | } 21 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o1timedreply.h: -------------------------------------------------------------------------------- 1 | #ifndef O1TIMEDREPLY_H 2 | #define O1TIMEDREPLY_H 3 | 4 | #include 5 | #include 6 | 7 | #include "o0export.h" 8 | 9 | /// A timer connected to a network reply. 10 | class O0_EXPORT O1TimedReply: public QTimer { 11 | Q_OBJECT 12 | 13 | public: 14 | explicit O1TimedReply(QNetworkReply *parent, int pTimeout=60*1000); 15 | 16 | Q_SIGNALS: 17 | /// Emitted when we have timed out waiting for the network reply. 18 | void error(QNetworkReply::NetworkError); 19 | /// Emitted when the network reply has responded. 20 | void finished(); 21 | 22 | private Q_SLOTS: 23 | void onFinished(); 24 | void onTimeout(); 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o1twitter.h: -------------------------------------------------------------------------------- 1 | #ifndef O1TWITTER_H 2 | #define O1TWITTER_H 3 | 4 | #include "o0export.h" 5 | #include "o1.h" 6 | 7 | #include 8 | 9 | /// Twitter OAuth 1.0 client 10 | class O0_EXPORT O1Twitter: public O1 { 11 | Q_OBJECT 12 | 13 | public: 14 | explicit O1Twitter(QObject *parent = 0): O1(parent) { 15 | setRequestTokenUrl(QUrl("https://api.twitter.com/oauth/request_token")); 16 | setAuthorizeUrl(QUrl("https://api.twitter.com/oauth/authenticate")); 17 | setAccessTokenUrl(QUrl("https://api.twitter.com/oauth/access_token")); 18 | setClientId(CLIENT_ID); 19 | setClientSecret(CLIENT_ID_SECRET); 20 | } 21 | 22 | }; 23 | 24 | #endif // O1TWITTER_H 25 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o2.pri: -------------------------------------------------------------------------------- 1 | include(src.pri) 2 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o2reply.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "o2reply.h" 5 | 6 | O2Reply::O2Reply(QNetworkReply *r, int timeOut, QObject *parent): QTimer(parent), reply(r) { 7 | setSingleShot(true); 8 | connect(this, SIGNAL(error(QNetworkReply::NetworkError)), reply, SIGNAL(error(QNetworkReply::NetworkError)), Qt::QueuedConnection); 9 | connect(this, SIGNAL(timeout()), this, SLOT(onTimeOut()), Qt::QueuedConnection); 10 | start(timeOut); 11 | } 12 | 13 | void O2Reply::onTimeOut() { 14 | Q_EMIT error(QNetworkReply::TimeoutError); 15 | } 16 | 17 | O2ReplyList::~O2ReplyList() { 18 | foreach (O2Reply *timedReply, replies_) { 19 | delete timedReply; 20 | } 21 | } 22 | 23 | void O2ReplyList::add(QNetworkReply *reply) { 24 | if (reply && ignoreSslErrors()) 25 | reply->ignoreSslErrors(); 26 | add(new O2Reply(reply)); 27 | } 28 | 29 | void O2ReplyList::add(O2Reply *reply) { 30 | replies_.append(reply); 31 | } 32 | 33 | void O2ReplyList::remove(QNetworkReply *reply) { 34 | O2Reply *o2Reply = find(reply); 35 | if (o2Reply) { 36 | o2Reply->stop(); 37 | (void)replies_.removeOne(o2Reply); 38 | } 39 | } 40 | 41 | O2Reply *O2ReplyList::find(QNetworkReply *reply) { 42 | foreach (O2Reply *timedReply, replies_) { 43 | if (timedReply->reply == reply) { 44 | return timedReply; 45 | } 46 | } 47 | return 0; 48 | } 49 | 50 | bool O2ReplyList::ignoreSslErrors() 51 | { 52 | return ignoreSslErrors_; 53 | } 54 | 55 | void O2ReplyList::setIgnoreSslErrors(bool ignoreSslErrors) 56 | { 57 | ignoreSslErrors_ = ignoreSslErrors; 58 | } 59 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o2reply.h: -------------------------------------------------------------------------------- 1 | #ifndef O2TIMEDREPLYLIST_H 2 | #define O2TIMEDREPLYLIST_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "o0export.h" 12 | 13 | /// A network request/reply pair that can time out. 14 | class O0_EXPORT O2Reply: public QTimer { 15 | Q_OBJECT 16 | 17 | public: 18 | O2Reply(QNetworkReply *reply, int timeOut = 60 * 1000, QObject *parent = 0); 19 | 20 | Q_SIGNALS: 21 | void error(QNetworkReply::NetworkError); 22 | 23 | public Q_SLOTS: 24 | /// When time out occurs, the QNetworkReply's error() signal is triggered. 25 | void onTimeOut(); 26 | 27 | public: 28 | QNetworkReply *reply; 29 | }; 30 | 31 | /// List of O2Replies. 32 | class O2ReplyList { 33 | public: 34 | O2ReplyList() { ignoreSslErrors_ = false; } 35 | 36 | /// Destructor. 37 | /// Deletes all O2Reply instances in the list. 38 | virtual ~O2ReplyList(); 39 | 40 | /// Create a new O2Reply from a QNetworkReply, and add it to this list. 41 | void add(QNetworkReply *reply); 42 | 43 | /// Add an O2Reply to the list, while taking ownership of it. 44 | void add(O2Reply *reply); 45 | 46 | /// Remove item from the list that corresponds to a QNetworkReply. 47 | void remove(QNetworkReply *reply); 48 | 49 | /// Find an O2Reply in the list, corresponding to a QNetworkReply. 50 | /// @return Matching O2Reply or NULL. 51 | O2Reply *find(QNetworkReply *reply); 52 | 53 | bool ignoreSslErrors(); 54 | void setIgnoreSslErrors(bool ignoreSslErrors); 55 | 56 | protected: 57 | QList replies_; 58 | bool ignoreSslErrors_; 59 | }; 60 | 61 | #endif // O2TIMEDREPLYLIST_H 62 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/o2replyserver.h: -------------------------------------------------------------------------------- 1 | #ifndef O2REPLYSERVER_H 2 | #define O2REPLYSERVER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "o0export.h" 10 | 11 | /// HTTP server to process authentication response. 12 | class O0_EXPORT O2ReplyServer: public QTcpServer { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit O2ReplyServer(QObject *parent = 0); 17 | 18 | /// Page content on local host after successful oauth - in case you do not want to close the browser, but display something 19 | Q_PROPERTY(QByteArray replyContent READ replyContent WRITE setReplyContent) 20 | QByteArray replyContent(); 21 | void setReplyContent(const QByteArray &value); 22 | 23 | Q_SIGNALS: 24 | void verificationReceived(QMap); 25 | 26 | public Q_SLOTS: 27 | void onIncomingConnection(); 28 | void onBytesReady(); 29 | QMap parseQueryParams(QByteArray *data); 30 | 31 | protected: 32 | QByteArray replyContent_; 33 | }; 34 | 35 | #endif // O2REPLYSERVER_H 36 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/oxtwitter.h: -------------------------------------------------------------------------------- 1 | #ifndef OXTWITTER_H 2 | #define OXTWITTER_H 3 | 4 | #include "o0export.h" 5 | #include "o1twitter.h" 6 | 7 | /// Twitter authenticator using Twitter XAuth 8 | class O0_EXPORT OXTwitter: public O1Twitter { 9 | Q_OBJECT 10 | 11 | public: 12 | explicit OXTwitter(QObject *parent = 0); 13 | 14 | /// XAuth Username 15 | Q_PROPERTY(QString username READ username WRITE setUsername NOTIFY usernameChanged) 16 | QString username(); 17 | void setUsername(const QString &username); 18 | 19 | /// XAuth Password 20 | Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged) 21 | QString password(); 22 | void setPassword(const QString &password); 23 | 24 | 25 | Q_PROPERTY(QString screen_name READ screenName) 26 | QString screenName(); 27 | 28 | public Q_SLOTS: 29 | /// Authenticate. 30 | Q_INVOKABLE virtual void link(); 31 | void onTokenRequestFinished(CURLcode code); 32 | void onGuestTokenRequestFinished(CURLcode code); 33 | void onChallengeSuccess(); 34 | 35 | 36 | Q_SIGNALS: 37 | void usernameChanged(); 38 | void passwordChanged(); 39 | 40 | private: 41 | // QList xAuthParams_; 42 | QString username_; 43 | QString password_; 44 | QString user_id, screen_name; 45 | QString login_verification_user_id, login_verification_request_id; 46 | }; 47 | 48 | #endif // OXTWITTER_H 49 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/o2/src.pri: -------------------------------------------------------------------------------- 1 | QT *= network 2 | 3 | # script module is deprecated since Qt 5.5 (http://wiki.qt.io/New-Features-in-Qt-5.5) 4 | !qtHaveModule(qml): QT *= script 5 | qtHaveModule(qml): QT *= qml 6 | 7 | INCLUDEPATH += $$PWD 8 | SOURCES += \ 9 | $$PWD/o1.cpp \ 10 | $$PWD/o1requestor.cpp \ 11 | $$PWD/o1timedreply.cpp \ 12 | $$PWD/o2.cpp \ 13 | $$PWD/o2facebook.cpp \ 14 | $$PWD/o2gft.cpp \ 15 | $$PWD/o2reply.cpp \ 16 | $$PWD/o2replyserver.cpp \ 17 | $$PWD/o2requestor.cpp \ 18 | $$PWD/o2skydrive.cpp \ 19 | $$PWD/oxtwitter.cpp \ 20 | $$PWD/o2simplecrypt.cpp \ 21 | $$PWD/o0baseauth.cpp \ 22 | $$PWD/o0settingsstore.cpp \ 23 | $$PWD/o2spotify.cpp 24 | 25 | HEADERS += \ 26 | $$PWD/o1.h \ 27 | $$PWD/o1dropbox.h \ 28 | $$PWD/o1flickr.h \ 29 | $$PWD/o1requestor.h \ 30 | $$PWD/o1twitter.h \ 31 | $$PWD/o1timedreply.h \ 32 | $$PWD/o2.h \ 33 | $$PWD/o2facebook.h \ 34 | $$PWD/o2gft.h \ 35 | $$PWD/o2reply.h \ 36 | $$PWD/o2replyserver.h \ 37 | $$PWD/o2requestor.h \ 38 | $$PWD/o2skydrive.h \ 39 | $$PWD/oxtwitter.h \ 40 | $$PWD/o1freshbooks.h \ 41 | $$PWD/o0baseauth.h \ 42 | $$PWD/o0globals.h \ 43 | $$PWD/o0simplecrypt.h \ 44 | $$PWD/o0requestparameter.h \ 45 | $$PWD/o0abstractstore.h \ 46 | $$PWD/o0settingsstore.h \ 47 | $$PWD/o2spotify.h 48 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/secret.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef SECRET_H 21 | #define SECRET_H 22 | 23 | #define CLIENT_ID "3nVuSoBZnx6U4vzUxf5w" 24 | #define CLIENT_ID_SECRET "Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys" 25 | 26 | #endif // SECRET_H 27 | -------------------------------------------------------------------------------- /Bird10HeadlessService/src/service.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Bird10 3 | * Copyright (C) 2020 Simone Dassi 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef SERVICE_H_ 21 | #define SERVICE_H_ 22 | 23 | #include 24 | #include 25 | #include 26 | #include "o2/oxtwitter.h" 27 | 28 | namespace bb { 29 | class Application; 30 | namespace platform { 31 | class Notification; 32 | } 33 | namespace system { 34 | class InvokeManager; 35 | class InvokeRequest; 36 | class InvokeReply; 37 | } 38 | } 39 | 40 | class Service: public QObject 41 | { 42 | Q_OBJECT 43 | public: 44 | Service(); 45 | virtual ~Service() {} 46 | 47 | static QThread curlThread; 48 | 49 | private slots: 50 | void handleInvoke(const bb::system::InvokeRequest &); 51 | void onTimeout(); 52 | void onError(); 53 | 54 | void onInvokeResult(); 55 | void quit(); 56 | 57 | void checkDM(); 58 | 59 | private: 60 | void checkNotifications(); 61 | 62 | void registerTimer(); 63 | void clearTimer(); 64 | void registerHeartbeat(); 65 | void clearHeartbeat(); 66 | 67 | void clearNotifications(); 68 | 69 | 70 | bb::system::InvokeManager * m_invokeManager; 71 | bb::system::InvokeReply* m_invokeReply; 72 | 73 | OXTwitter* m_authenticator; 74 | 75 | QSettings* m_settings; 76 | 77 | bool m_running; 78 | }; 79 | 80 | #endif /* SERVICE_H_ */ 81 | -------------------------------------------------------------------------------- /Bird10HeadlessService/translations/Bird10HeadlessService.pro: -------------------------------------------------------------------------------- 1 | include (../Bird10HeadlessService.pro) 2 | -------------------------------------------------------------------------------- /Bird10HeadlessService/translations/Bird10HeadlessService.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimoDax/Bird10/990ddb16283d084090dc0ef93215726577ac6691/Bird10HeadlessService/translations/Bird10HeadlessService.qm -------------------------------------------------------------------------------- /Bird10HeadlessService/translations/Bird10HeadlessService.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Bird10HeadlessService/translations/Makefile: -------------------------------------------------------------------------------- 1 | QMAKE_TARGET = Bird10HeadlessService 2 | LUPDATE = $(QNX_HOST)/usr/bin/lupdate 3 | LRELEASE = $(QNX_HOST)/usr/bin/lrelease 4 | 5 | update: $(QMAKE_TARGET).pro FORCE 6 | $(LUPDATE) $(QMAKE_TARGET).pro 7 | 8 | release: $(QMAKE_TARGET).pro $(QMAKE_TARGET).ts 9 | $(LRELEASE) $(QMAKE_TARGET).pro 10 | 11 | FORCE: 12 | 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Bird10 for BlackBerry 2 | 3 | App structure: Qml (Bird10/assets) for ui and app flow, C++ (Bird10/src) for fetching, parsing & data storage. 4 | The code for the background service has its own project folder, Bird10HeadlessService 5 | 6 | Qml also holds and instantiates the C++ classes, which are exposed as objects in the meta-object system. 7 | Every web request to Twitter apis is handled by libcurl because of tls requirements, QNetworkAccessManager in qt4.8 is too outdated 8 | 9 | External libs: 10 | - **QJson4**: A simple library to have a json parser like the one built in qt5 11 | - **QtCurl**: Qt wrapper around libcurl. Heavily customised wrt to the original project to make it work on OS10 12 | - **o2**: C++ OAuth library for Qt. Customised to work with Twitter private apis and with QtCurl instead of QNetworkRequest 13 | 14 | I tried to keep every app functionality in its own class. It does not aim to be a perfectly classful code like the ones Java programmers love to write, instead it's a tradeoff between a tidy codebase and writing/mantaining/debugging speed. 15 | Two classes are abstract: 16 | - **TwitterApiBase**: every class that should interface with the api should derive from this one, since it already has an authenticator and a requestor (which is a factory for o2-authenticated, QtCurl-based web requests) 17 | - **TimelineBase**: every class that handles a timeline (or more broadly a list of tweets) should derive from this one (which already derives from TwitterApiBase), since it has all the code to parse them. It does not have a container for them however. 18 | - Moreover, if a class with a container and retweet / like capabailities is needed, extending TwitterApi (which already derives from TimelineBase) is a good choice 19 | 20 | Side notes: 21 | 22 | Some (few) of the Qml code is ripped off from the official app as I wanted a similar style :) 23 | 24 | All the o1Twitter references in the Qml actually refer to the OXTwitter object (because it is registered in that way in the meta-object system), not to O1Twitter. Originally the app used OAuth 1.0 instead of XAuth and I was too lazy to change all the names, so I just changed the actual class getting instantiated when I switched to XAuth. 25 | --------------------------------------------------------------------------------